Skip to content

Embed functionality breaks when using Vite import() #511

@acidtone

Description

@acidtone

Describe the bug

sveltekit-embed doesn't embed content when it's rendered as a dynamic markdown import.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Test Page
  2. No YouTube content loads under "Test Page: YouTube Embed"

Expected behavior

YouTube content should load normally.

Additional context

GitHub Repo: https://github.com/acidtone/sveltekit-embed-test/

The above repo is a reproduction of the problem I'm experiencing on a larger markdown website. Content is loaded dynamically using Vite's import() function in /routes/+page.server.js.

The package works great with normal .svelte and .md content but breaks when I import at compile time. This makes sense to me but is there any way around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions