tecnologías / sveltekit / 2.0.0 SvelteKit 2.0.0 2023-12-14 featured
note: la síntesis y las notas de la versión están en inglés
warning: requiere intervención
25 breaking changes 5 puntos clave
Major release with many breaking changes: Svelte 3 dropped, Node 18.13+ and Vite 5.0.3+ required. síntesis · solo a partir de las notas de la versión · claude-haiku-5-5 · prompt v7
breaking changestodos citados, cada uno con su solución breaking[1]: Top-level promises are no longer awaited. 3 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. 5 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. 7 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.9 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. 11 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. 13 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. 15 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.17 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. 19 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. 21 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.23 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. 25 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. 27 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. 29 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.31 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. 33 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. 35 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. 37 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. 39 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. 41 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. 43 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. 45 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. 47 breaking: require Node 18.13 or newer ( #11172 ) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: Upgrade Node to 18.13 or newer.
breaking[24]: Path resolution has changed. 49 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. 51 breaking: remove dangerZone.trackServerFetches ( #11235 ) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: Remove dangerZone.trackServerFetches from your config.
puntos clave release-notesgithub.com/sveltejs/kit · 77 líneas ### Major Changes - breaking: remove top-level promise awaiting ([#11176](https://github.com/sveltejs/kit/pull/11176)) - breaking: prevent use of dynamic env vars during prerendering, serve env vars dynamically ([#11277](https://github.com/sveltejs/kit/pull/11277)) - breaking: remove deprecated `use:enhance` callback values ([#11282](https://github.com/sveltejs/kit/pull/11282)) - breaking: turn `error` and `redirect` into commands ([#11165](https://github.com/sveltejs/kit/pull/11165)) - breaking: the type for `depends` now requires a `:` as part of the string ([#11201](https://github.com/sveltejs/kit/pull/11201)) - breaking: remove baseUrl fallback from generated tsconfig ([#11294](https://github.com/sveltejs/kit/pull/11294)) - breaking: fail if route with +page and +server is marked prerenderable ([#11256](https://github.com/sveltejs/kit/pull/11256)) - breaking: remove `resolvePath` in favour of `resolveRoute` from `$app/paths` ([#11265](https://github.com/sveltejs/kit/pull/11265)) - breaking: drop support for Svelte 3 ([#11168](https://github.com/sveltejs/kit/pull/11168)) - breaking: require Vite 5.0.3+ ([#11122](https://github.com/sveltejs/kit/pull/11122)) - breaking: generate `__data.json` files as sibling to `.html` files ([#11269](https://github.com/sveltejs/kit/pull/11269)) - breaking: fail if +page and +server have mismatched config ([#11256](https://github.com/sveltejs/kit/pull/11256)) - breaking: error if form without multipart/form-data enctype contains a file input ([#11282](https://github.com/sveltejs/kit/pull/11282)) - breaking: require paths pass to preloadCode to be prefixed with basepath ([#11259](https://github.com/sveltejs/kit/pull/11259)) - 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)) - breaking: stop re-exporting vitePreprocess ([#11297](https://github.com/sveltejs/kit/pull/11297)) - breaking: require path option when setting/deleting/serializing cookies ([#11240](https://github.com/sveltejs/kit/pull/11240)) - breaking: tighten up error handling ([#11289](https://github.com/sveltejs/kit/pull/11289)) - breaking: remove state option from goto in favor of shallow routing ([#11307](https://github.com/sveltejs/kit/pull/11307)) - breaking: disallow external navigation with `goto` ([#11207](https://github.com/sveltejs/kit/pull/11207)) - 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)) - breaking: undefined is no longer a valid value for paths.relative ([#11185](https://github.com/sveltejs/kit/pull/11185)) - breaking: require Node 18.13 or newer ([#11172](https://github.com/sveltejs/kit/pull/11172)) - breaking: fix path resolution ([#11276](https://github.com/sveltejs/kit/pull/11276)) - breaking: remove `dangerZone.trackServerFetches` ([#11235](https://github.com/sveltejs/kit/pull/11235)) ### Minor Changes - feat: add untrack to load ([#11311](https://github.com/sveltejs/kit/pull/11311)) - feat: implement shallow routing ([#11307](https://github.com/sveltejs/kit/pull/11307)) - feat: provide SvelteKit html typings ([#11222](https://github.com/sveltejs/kit/pull/11222)) - feat: redact internal stack trace when reporting config errors ([#11292](https://github.com/sveltejs/kit/pull/11292)) - feat: allow for fine grained invalidation of search params ([#11258](https://github.com/sveltejs/kit/pull/11258)) ### Patch Changes - fix: prerender optional parameters as empty when `entries` contains `'*'` ([#11178](https://github.com/sveltejs/kit/pull/11178)) - fix: resolve route config correctly ([#11256](https://github.com/sveltejs/kit/pull/11256)) - fix: import Svelte types from svelte/compiler ([#11188](https://github.com/sveltejs/kit/pull/11188)) - fix: reset invalid resources after a successful invalidation ([#11268](https://github.com/sveltejs/kit/pull/11268)) - fix: Adjust fail method and ActionFailure type ([#11260](https://github.com/sveltejs/kit/pull/11260)) - chore(deps): upgrade cookies dependency ([#11189](https://github.com/sveltejs/kit/pull/11189)) --> ver en github imported 2026-09-28 vía npm