fix: treat client/universal hooks as entrypoints for illegal server import detection...
authorRich Harris <richard.a.harris@gmail.com>
Thu, 20 Nov 2025 09:06:49 +0000 (04:06 -0500)
committerGitHub <noreply@github.com>
Thu, 20 Nov 2025 09:06:49 +0000 (10:06 +0100)
* fix: treat client/universal hooks as entrypoints for illegal server import detection

* remove test file

.changeset/spotty-kings-pull.md [new file with mode: 0644]
packages/kit/src/exports/vite/index.js

diff --git a/.changeset/spotty-kings-pull.md b/.changeset/spotty-kings-pull.md
new file mode 100644 (file)
index 0000000..039e4ee
--- /dev/null
@@ -0,0 +1,5 @@
+---
+'@sveltejs/kit': patch
+---
+
+fix: treat client/universal hooks as entrypoints for illegal server import detection
index 14a1103f6a618aaa34947ca5cc51484ae343c26b..c1b12dbd06e6536c616c64e8ac5454ed0a8f4be0 100644 (file)
@@ -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];