diff --git a/.changeset/spotty-kings-pull.md b/.changeset/spotty-kings-pull.md new file mode 100644 index 000000000000..039e4ee3424c --- /dev/null +++ b/.changeset/spotty-kings-pull.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +fix: treat client/universal hooks as entrypoints for illegal server import detection diff --git a/packages/kit/src/exports/vite/index.js b/packages/kit/src/exports/vite/index.js index 7d6cf2a9589f..68adabdd8661 100644 --- a/packages/kit/src/exports/vite/index.js +++ b/packages/kit/src/exports/vite/index.js @@ -598,6 +598,9 @@ async function kit({ svelte_config }) { if (node.universal) entrypoints.add(node.universal); } + if (manifest_data.hooks.client) entrypoints.add(manifest_data.hooks.client); + if (manifest_data.hooks.universal) entrypoints.add(manifest_data.hooks.universal); + const normalized = normalize_id(id, normalized_lib, normalized_cwd); const chain = [normalized];