Skip to content
verdict:

SvelteKit 2.0.0

featured

warning: action required

25 breaking changes5 key points

Major release with many breaking changes: Svelte 3 dropped, Node 18.13+ and Vite 5.0.3+ required.

summary · from the release notes only · claude-haiku-5-5 · prompt v7

breaking changesall cited, each with a fix

breaking[1]: Top-level promises are no longer awaited.

breaking: remove top-level promise awaiting (#11176)

help: Await promises explicitly in your load functions and check code that relied on top-level awaiting.

breaking[2]: Dynamic env vars can no longer be used during prerendering; env vars are served dynamically.

breaking: prevent use of dynamic env vars during prerendering, serve env vars dynamically (#11277)

help: Check prerendered pages for env var use and move that code to runtime.

breaking[3]: Deprecated callback values for use:enhance are removed.

breaking: remove deprecated use:enhance callback values (#11282)

help: Check custom use:enhance callbacks and update them to the current callback API.

breaking[4]: error and redirect are now commands.

breaking: turn error and redirect into commands (#11165)

help: Check every call to error and redirect and update it to the new command form.

breaking[5]: The type for depends now requires a : in the string.

breaking: the type for depends now requires a : as part of the string (#11201)

help: Add a : to each depends string.

breaking[6]: The generated tsconfig no longer falls back to baseUrl.

breaking: remove baseUrl fallback from generated tsconfig (#11294)

help: Check whether your code relies on baseUrl and set it explicitly if needed.

breaking[7]: Builds fail when a route with +page and +server is marked prerenderable.

breaking: fail if route with +page and +server is marked prerenderable (#11256)

help: Remove the prerender setting from routes that have both +page and +server files.

breaking[8]: resolvePath is removed.

breaking: remove resolvePath in favour of resolveRoute from $app/paths (#11265)

help: Replace resolvePath with resolveRoute from $app/paths.

breaking[9]: Svelte 3 is no longer supported.

breaking: drop support for Svelte 3 (#11168)

help: Upgrade Svelte before upgrading SvelteKit; the notes do not name a version.

breaking[10]: Vite 5.0.3 or newer is required.

breaking: require Vite 5.0.3+ (#11122)

help: Upgrade Vite to 5.0.3 or newer.

breaking[11]: __data.json files are generated as siblings of .html files.

breaking: generate __data.json files as sibling to .html files (#11269)

help: Check any code or hosting rules that expect __data.json in another location.

breaking[12]: Builds fail when +page and +server have mismatched config.

breaking: fail if +page and +server have mismatched config (#11256)

help: Make the config in your +page and +server files match.

breaking[13]: Forms with a file input but without a multipart/form-data enctype now error.

breaking: error if form without multipart/form-data enctype contains a file input (#11282)

help: Add enctype="multipart/form-data" to those forms.

breaking[14]: Paths passed to preloadCode must be prefixed with the basepath.

breaking: require paths pass to preloadCode to be prefixed with basepath (#11259)

help: Prefix every path passed to preloadCode with your basepath.

breaking[15]: @sveltejs/vite-plugin-svelte is now a peer dependency.

breaking: @sveltejs/vite-plugin-svelte is now a peer dependency and will need to be installed in each project using SvelteKit (#11184)

help: Install @sveltejs/vite-plugin-svelte in each project that uses SvelteKit.

breaking[16]: SvelteKit no longer re-exports vitePreprocess.

breaking: stop re-exporting vitePreprocess (#11297)

help: Check imports of vitePreprocess and import it from the package that provides it.

breaking[17]: Cookie set, delete and serialize calls require a path option.

breaking: require path option when setting/deleting/serializing cookies (#11240)

help: Pass a path option to every cookie set, delete and serialize call.

breaking[18]: Error handling is stricter.

breaking: tighten up error handling (#11289)

help: Review your error handling code; the notes give no further detail.

breaking[19]: The state option is removed from goto.

breaking: remove state option from goto in favor of shallow routing (#11307)

help: Use shallow routing in place of goto's state option.

breaking[20]: goto can no longer navigate to external URLs.

breaking: disallow external navigation with goto (#11207)

help: Use a regular link or window.location for external URLs.

breaking[21]: TypeScript 5 is required, and moduleResolution defaults to bundler in user projects.

breaking: upgrade to TypeScript 5. Default moduleResolution to bundler in user projects to be permissive in consuming and NodeNext when running package to be strict in distributing (#11160)

help: Upgrade to TypeScript 5 and check your moduleResolution setting.

breaking[22]: undefined is no longer a valid value for paths.relative.

breaking: undefined is no longer a valid value for paths.relative (#11185)

help: Set paths.relative to a defined value.

breaking[23]: Node 18.13 or newer is required.

breaking: require Node 18.13 or newer (#11172)

help: Upgrade Node to 18.13 or newer.

breaking[24]: Path resolution has changed.

breaking: fix path resolution (#11276)

help: Check the paths your app resolves; the notes give no further detail.

breaking[25]: The dangerZone.trackServerFetches option is removed.

breaking: remove dangerZone.trackServerFetches (#11235)

help: Remove dangerZone.trackServerFetches from your config.

key points

release-notesgithub.com/sveltejs/kit · 77 lines
  1. ### Major Changes
  2. - breaking: remove top-level promise awaiting ([#11176](https://github.com/sveltejs/kit/pull/11176))
  3. - breaking: prevent use of dynamic env vars during prerendering, serve env vars dynamically ([#11277](https://github.com/sveltejs/kit/pull/11277))
  4. - breaking: remove deprecated `use:enhance` callback values ([#11282](https://github.com/sveltejs/kit/pull/11282))
  5. - breaking: turn `error` and `redirect` into commands ([#11165](https://github.com/sveltejs/kit/pull/11165))
  6. - breaking: the type for `depends` now requires a `:` as part of the string ([#11201](https://github.com/sveltejs/kit/pull/11201))
  7. - breaking: remove baseUrl fallback from generated tsconfig ([#11294](https://github.com/sveltejs/kit/pull/11294))
  8. - breaking: fail if route with +page and +server is marked prerenderable ([#11256](https://github.com/sveltejs/kit/pull/11256))
  9. - breaking: remove `resolvePath` in favour of `resolveRoute` from `$app/paths` ([#11265](https://github.com/sveltejs/kit/pull/11265))
  10. - breaking: drop support for Svelte 3 ([#11168](https://github.com/sveltejs/kit/pull/11168))
  11. - breaking: require Vite 5.0.3+ ([#11122](https://github.com/sveltejs/kit/pull/11122))
  12. - breaking: generate `__data.json` files as sibling to `.html` files ([#11269](https://github.com/sveltejs/kit/pull/11269))
  13. - breaking: fail if +page and +server have mismatched config ([#11256](https://github.com/sveltejs/kit/pull/11256))
  14. - breaking: error if form without multipart/form-data enctype contains a file input ([#11282](https://github.com/sveltejs/kit/pull/11282))
  15. - breaking: require paths pass to preloadCode to be prefixed with basepath ([#11259](https://github.com/sveltejs/kit/pull/11259))
  16. - breaking: `@sveltejs/vite-plugin-svelte` is now a peer dependency and will need to be installed in each project using SvelteKit ([#11184](https://github.com/sveltejs/kit/pull/11184))
  17. - breaking: stop re-exporting vitePreprocess ([#11297](https://github.com/sveltejs/kit/pull/11297))
  18. - breaking: require path option when setting/deleting/serializing cookies ([#11240](https://github.com/sveltejs/kit/pull/11240))
  19. - breaking: tighten up error handling ([#11289](https://github.com/sveltejs/kit/pull/11289))
  20. - breaking: remove state option from goto in favor of shallow routing ([#11307](https://github.com/sveltejs/kit/pull/11307))
  21. - breaking: disallow external navigation with `goto` ([#11207](https://github.com/sveltejs/kit/pull/11207))
  22. - breaking: upgrade to TypeScript 5. Default `moduleResolution` to `bundler` in user projects to be permissive in consuming and `NodeNext` when running `package` to be strict in distributing ([#11160](https://github.com/sveltejs/kit/pull/11160))
  23. - breaking: undefined is no longer a valid value for paths.relative ([#11185](https://github.com/sveltejs/kit/pull/11185))
  24. - breaking: require Node 18.13 or newer ([#11172](https://github.com/sveltejs/kit/pull/11172))
  25. - breaking: fix path resolution ([#11276](https://github.com/sveltejs/kit/pull/11276))
  26. - breaking: remove `dangerZone.trackServerFetches` ([#11235](https://github.com/sveltejs/kit/pull/11235))
  27. ### Minor Changes
  28. - feat: add untrack to load ([#11311](https://github.com/sveltejs/kit/pull/11311))
  29. - feat: implement shallow routing ([#11307](https://github.com/sveltejs/kit/pull/11307))
  30. - feat: provide SvelteKit html typings ([#11222](https://github.com/sveltejs/kit/pull/11222))
  31. - feat: redact internal stack trace when reporting config errors ([#11292](https://github.com/sveltejs/kit/pull/11292))
  32. - feat: allow for fine grained invalidation of search params ([#11258](https://github.com/sveltejs/kit/pull/11258))
  33. ### Patch Changes
  34. - fix: prerender optional parameters as empty when `entries` contains `'*'` ([#11178](https://github.com/sveltejs/kit/pull/11178))
  35. - fix: resolve route config correctly ([#11256](https://github.com/sveltejs/kit/pull/11256))
  36. - fix: import Svelte types from svelte/compiler ([#11188](https://github.com/sveltejs/kit/pull/11188))
  37. - fix: reset invalid resources after a successful invalidation ([#11268](https://github.com/sveltejs/kit/pull/11268))
  38. - fix: Adjust fail method and ActionFailure type ([#11260](https://github.com/sveltejs/kit/pull/11260))
  39. - chore(deps): upgrade cookies dependency ([#11189](https://github.com/sveltejs/kit/pull/11189))

view on githubimported 2026-09-28 via npm