New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External components not correctly compiled in SSR mode #366
Comments
The |
I encountered this when trying to use https://github.com/RobBrazier/svelte-awesome I did see |
@FredKSchott I'm not sure if you might have any idea about this one |
It turns out this is because Snowpack pre-bundles dependencies. Rich also hit this when working on the SvelteKit documentation sveltejs/sites#1. Kit needs to build two apps, one SSR, one DOM. If components are prebundled, you're stuck with DOM |
Previous discussion: FredKSchott/snowpack#1808 |
Thanks for tagging, that summary sounds correct. I'm actually just looking at our dependency story today and supporting passing some deps (like Svelte) through your normal build pipeline instead of pre-bundling. Will keep this thread (and the one Rich linked to) updated |
Update: I've been working hard on a refactor of the Snowpack internals which adds support for (among other things) Svelte SSR packages. PR just opened here fixes this issue: FredKSchott/snowpack#2707 |
It seems that external components (installed to
node_modules
) do not correctly work with Kit. We end up trying to run a browser-compiled version of them as part of the SSR code, which results in the runtimeis not a valid SSR component
error.The issue does not seem to be that Kit and/or Snowpack is not correctly resolving
pkg.svelte
. It appears to be finding the correct component file to compile, and it is compiling it, but it's compiling it in DOM mode when it ought to be compiling it in SSR mode.I haven't made any real progress on determining whether this is a Kit bug or a Snowpack (or its plugin) bug.
The text was updated successfully, but these errors were encountered: