SvelteKit 2, with the Vite 5 toolchain it needs (supersedes #176) - #224
Merged
Merged
Conversation
Dependabot's #176 bumped @sveltejs/kit to 2 and adapter-static to 3 on their own, and its CI died at `npm install`: Kit 2 needs Vite 5, the repo was on Vite 4, and vitest 0.32 pinned Vite 4 through vite-node. This does the whole step at once: - @sveltejs/kit 1.30.4 -> 2.70.3, @sveltejs/adapter-static 2.0.3 -> 3.0.10 - @sveltejs/vite-plugin-svelte 3.1.2, now a direct dependency (a peer of Kit 2); 3.x is the line that supports Svelte 4, which stays at 4.2.19 - vite 4.5.12 -> 5.4.21, vitest 0.32.4 -> 3.2.7 (no tests exist yet; it is the newest line that still accepts Vite 5) - typescript 5.2.2 -> 5.9.3 (Kit 2 wants ^5.3.3), svelte-check 3.5.2 -> 3.8.6 - devalue, which the Dependabot PR was about, goes 4.3.2 -> 5.9.4 Code: `vitePreprocess` now comes from @sveltejs/vite-plugin-svelte, and the nine `throw error(...)` in the tools loaders lose the `throw` (in Kit 2 `error()` throws by itself). Nothing else in the migration guide applies: no cookies, `goto`, `$env/dynamic`, `$app/paths`, hooks, form actions or top-level promises in a load. npm could not move Kit, adapter-static and Vite together from the old lockfile (it checks each new peer against the version still installed), so the lockfile was produced with --legacy-peer-deps and then re-run with a plain `npm install`, which leaves `npm ls --all` clean. A fresh install from the lockfile in an empty folder, as CI does it, resolves without error. Checked: svelte-check 0 errors; `vite build` writes the same 1,371 pages and 5,278 other files, every static file byte-identical, and every page's HTML identical once scripts, stylesheet links and hashes are set aside. The CSS each page loads has the same rules; the only differences are asset hash formats and the new esbuild writing rgba(255,255,255,.25) as #ffffff40. pnpm-lock.yaml is left alone: it was already stale (it has no posthog-js, gsap or three) and npm is what CI and the deploy use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vitest 0.32 depended on @types/node, so the Node types came in with it; vitest 3 only lists them as an optional peer, and with the upgrade they left the tree. CI's svelte-check then found 25 errors, all from that one gap: `node:path`, `node:fs/promises` and `path` unresolved in the tools loaders, src/lib/server/ipa.ts and vite.config.ts, and everything typed from them falling back to `any`. The local check had passed because this worktree sits inside the main checkout, and TypeScript found @types/node in the parent's node_modules. Pinned to the 20 line, the Node version CI and the deploy run on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #176. Dependabot bumped
@sveltejs/kitto 2 and@sveltejs/adapter-staticto 3 on their own, and its CI failed atnpm install(ERESOLVE): Kit 2 needs Vite 5, the repo was on Vite 4, and vitest 0.32 pinned Vite 4 through vite-node. This PR does the whole step.Versions
@sveltejs/kit@sveltejs/adapter-static@sveltejs/vite-plugin-sveltevitevitesttypescriptsvelte-checkdevalue(what #176 was about)@types/nodeSvelte stays on 4.2.19; vite-plugin-svelte 3 is the line that supports it. sass stays on 1.69.4.
Code — two changes from the migration guide, the rest do not apply here (no cookies,
goto,$env/dynamic,$app/paths, hooks, form actions or top-level promises in a load):svelte.config.jsimportsvitePreprocessfrom@sveltejs/vite-plugin-svelte.throw error(...)in the tools loaders drop thethrow.Checks
npm run check: 0 errors (warnings went from 8 to 2; the newer svelte-check knowstext-wrapandcontainer-type).vite buildbefore and after: the same 1,371 pages and 5,278 other files. Every static file is byte-identical. Every page's HTML is identical once scripts, stylesheet links and hashes are set aside. The CSS each page loads has the same rules; only the asset hash format changes, and the newer esbuild writesrgba(255,255,255,.25)as the equivalent#ffffff40.npm installfrom the new lockfile in an empty folder, as CI does it, resolves with no conflicts.npm run build(image optimisation and sitemap) under Node 20, the CI version.Notes
@types/nodein, vitest 3 does not, sonode:pathandnode:fs/promiseswent untyped. It passed locally because the worktree sits inside the main checkout and TypeScript found the types in the parent'snode_modules. The second commit adds@types/node20 directly, and the whole CI job (cleannpm install,npm run check, fullnpm run build) was then re-run under Node 20 in a copy outside the checkout: 0 errors, 1,371 pages, output identical to the local build.--legacy-peer-depsand then re-run with a plainnpm install;npm ls --allis clean.pnpm-lock.yamlis left alone. It was already stale (no posthog-js, gsap or three) and npm is what CI and the deploy use.npm run buildfails on Node 24 in theimage-transmutationpostbuild step (itsesmloader breaks). That is unrelated to this change and does not affect CI, which runs Node 20.🤖 Generated with Claude Code