You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In vite3, dependencies are treated differently in ssr dev. Due to that, libraries that have svelte as a dependency or peer dependency but do not contain svelte components or a "svelte" field in package.json need to be added to ssr.noExternal as well, otherwise deduplication of svelte fails and we get a runtime error.
Function called outside component initialization
Error: Function called outside component initialization
at get_current_component (file:///home/dominikg/develop/sveltejs/vite-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/svelte/internal/index.mjs:953:15)
at setContext (file:///home/dominikg/develop/sveltejs/vite-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/svelte/internal/index.mjs:985:5)
at Proxy.setSomeContext (file:///home/dominikg/develop/sveltejs/vite-plugin-svelte/packages/e2e-tests/_test_dependencies/svelte-api-only/index.js:4:2)
at index.svelte:35:1
at Object.$$render (/home/dominikg/develop/sveltejs/vite-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/svelte/internal/index.js:1758:22)
at Object.default (root.svelte:43:39)
at eval (/.svelte-kit/runtime/components/layout.svelte:8:41)
at Object.$$render (/home/dominikg/develop/sveltejs/vite-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/svelte/internal/index.js:1758:22)
at root.svelte:37:37
at $$render (/home/dominikg/develop/sveltejs/vite-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/svelte/internal/index.js:1758:22)
System Info
-
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered:
Describe the bug
In vite3, dependencies are treated differently in ssr dev. Due to that, libraries that have svelte as a dependency or peer dependency but do not contain svelte components or a "svelte" field in package.json need to be added to ssr.noExternal as well, otherwise deduplication of
svelte
fails and we get a runtime error.Reproduction
comment noExternal config in https://github.com/sveltejs/vite-plugin-svelte/blob/vite-3/packages/e2e-tests/kit-node/svelte.config.js#L14 and run
rm -rf node_modules/.vite && pnpm dev
inkit-node
Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: