Packages

@sveltejs/kit

3.3.0 · 17 Nov 2026MIT5.1M / weekRepositoryHomepagenpmAtom feed

Your version

3.0.0

major1 Oct 2026Where it was published

3.4.0 is the newest release of 3.x.

In short

76 breaking1 security6 deprecated34 new6 faster172 fixed42 internal

  • Breaking

    Move remote function types to $app/server

  • Breaking

    Remove experimental.handleRenderingErrors flag

  • Breaking

    Make getRequest and setResponse synchronous

  • Breaking

    TypeScript 6 is now the minimum required version

  • Breaking

    Refresh all load functions/queries when clicking a link to the current URL

  • Breaking

    Upgrade to cookie v2. Cookie names must now contain only ASCII characters

  • Breaking

    Require Node 22 or newer

  • Breaking

    Error when a client-requested single-flight mutation isn't respected by the server, allow the server to explicitly ignore refreshes

Security

Fixes 2 advisories that affected 2.70.4

Release note

Major Changes

  • Breaking

    Move remote function types to $app/server

  • Breaking

    Remove experimental.handleRenderingErrors flag

  • Breaking

    Make getRequest and setResponse synchronous

  • Breaking

    TypeScript 6 is now the minimum required version

  • Breaking

    Refresh all load functions/queries when clicking a link to the current URL

  • Breaking

    Move remote function types to $app/server

  • Breaking

    Upgrade to cookie v2. Cookie names must now contain only ASCII characters

  • Breaking

    Require Node 22 or newer

  • Breaking

    Error when a client-requested single-flight mutation isn't respected by the server, allow the server to explicitly ignore refreshes

  • Breaking

    Remove the preloadStrategy option. modulepreload will always be used

  • Breaking

    Default the cookie path option to '/'

  • Breaking

    Remove @sveltejs/kit/node/polyfills

  • Breaking

    Add config.kit.output.linkHeaderPreload to preload using the Link header

  • Breaking

    Require @sveltejs/vite-plugin-svelte v7

  • Breaking

    Make page.url immutable on a type level

  • Breaking

    Remove base, assets, and resolveRoute from $app/paths

  • Breaking

    Remove createEntries from the Builder object passed to adapter functions

  • Breaking

    Return no content for 204 responses

  • Breaking

    Rename Pathname type to Path and Asset to AssetPath
    breaking: remove leading / from Path and AssetPath

  • Breaking

    handle's resolve is now typed to always return a Promise

  • Breaking

    Remove Server constructor and SSRManifest from public types

  • Breaking

    Require Svelte config options to be passed through the Vite plugin

  • Breaking

    Form action responses now use the HTTP status code returned from fail

  • Breaking

    Write tsconfig to node_modules/$app/tsconfig

  • Breaking

    Move defineParams and associated types to @sveltejs/kit/params

  • Breaking

    Remove the deprecated CSRF checkOrigin option in favor of trustedOrigins

  • Breaking

    The delta property now only exists for popstate navigation events

  • Breaking

    Change form.error type from any to App.Error | undefined

  • Breaking

    Remove deprecated pragma header in version polling for improved CORS support

  • Breaking

    goto now rejects when called with a URL that does not resolve to a route within the app, matching the existing behaviour for external URLs

  • Breaking

    Run all errors through the handleError hook

  • Breaking

    Require Svelte 5.56.4 or newer

  • Breaking

    Error on event.url, event.params and event.route access inside queries

  • Breaking

    Enhanced cross-page form actions now navigate to the action page on success and failure, matching native form behavior

  • Breaking

    Delete $service-worker module

  • Breaking

    Move defineEnvVars to @sveltejs/kit/env

  • Breaking

    Nested server-only directories

  • Breaking

    Allow adapters to provide additional Vite plugins

  • Breaking

    Replace the $lib alias with #lib and remove files.lib config.

  • Breaking

    Remove #lib definition from paths; requires explicit module extensions as a result

  • Breaking

    Change error, isHttpError, redirect, and isRedirect to refer to public type instead of internal class

  • Breaking

    Move hooks-related types to @sveltejs/kit/hooks

  • Breaking

    Add 'error' result type to preloadData

  • Breaking

    Detect new deployments on data, remote, and form action responses, tab focus, and visibility change, and default version.pollInterval to 1 hour

  • Breaking

    Disallow cross-origin form submissions without a Content-Type header

  • Breaking

    Server-only directories (/server/ in the path) are now treated as server-only everywhere inside the project (except src/routes and the assets directory)

  • Breaking

    config exported from a universal route file takes precedence over a server one

  • Breaking

    Require Vite 8. Provides new functionality even for existing Vite 8 users such as faster builds with Vite hook filters and more powerful SvelteKit adapters with the Vite environment API

  • Breaking

    Remove data-sveltekit-* option 'off' in favour of false

  • Breaking

    Move tracing out of the experimental namespace and remove the instrumentation flag

  • Breaking

    Add kit.paths.origin config option, remove kit.prerender.origin and the adapter-node ORIGIN environment variable

  • Breaking

    Move Page, ReadonlyURL and ReadonlyURLSearchParams from @sveltejs/kit to $app/state

  • Breaking

    Remove $app/stores

  • Breaking

    Add refreshAll and deprecate invalidateAll

  • Breaking

    Reject query parameters beginning with x-sveltekit-

  • Breaking

    Disallow *.remote.ts/js files unless experimental.remoteFunctions is enabled

  • Breaking

    Replace the noScroll and keepFocus options of goto with a single reset option, and the data-sveltekit-noscroll and data-sveltekit-keepfocus attributes with data-sveltekit-reset

  • Breaking

    Don't abort navigation when calling invalidate(All) during navigation

  • Breaking

    Consistent special filename patterns

  • Breaking

    Allow handleError to influence status code

  • Breaking

    Delegate CORS handling to Vite for static directory requests during development

  • Breaking

    Require vite@^8.0.12, the first Vite 8 release bundling stable rolldown 1.0.0

  • Breaking

    Only include routes with a +page or +server in RouteId

  • Breaking

    Require Node 22.17

  • Breaking

    Deprecate error(status, {...}) in favour of error(status, message, {...})

  • Breaking

    Replace the builder.generateManifest with builder.generateServerInstance and builder.manifest

  • Breaking

    Forbid external redirects by default

  • Breaking

    Separate adapter Vite plugins into pre and post

  • Breaking

    Remove param files in folder in favor of params.js/ts file

  • Breaking

    Move env-related types to @sveltejs/kit/env

  • Breaking

    preloadCode now takes a route ID (e.g. /blog/[slug]) instead of a pathname. Route IDs are not prefixed with paths.base

  • Breaking

    Move BeforeNavigate, OnNavigate, AfterNavigate, Navigation, NavigationTarget, NavigationType, GotoOptions and the Navigation* variant types from @sveltejs/kit to $app/navigation

  • Breaking

    Move ActionResult and SubmitFunction from @sveltejs/kit to $app/forms

  • Breaking

    Remove handleValidationError and pass remote function validation errors to handleError with kind: 'validation'

  • Breaking

    Remove deprecated .run() method from live queries

Minor Changes

  • Allow hyphens in param and matcher names

  • Add $app/manifest module with immutable, assets, prerendered, and routes exports

  • Ignore files with + prefix if they contain test/spec/stories

  • Add ErrorProps to generated types

  • Support sourcemaps in production

  • Return the list of compressed files from builder.compress

  • Better response logging

  • Warn when tsconfig doesn't exclude service worker

  • Validate that all remote form fields were created with form.fields.foo.as(...)

  • Support function validators for environment variables

  • Use type: 'module' for service worker registrations

  • Allow adapters to receive the Svelte config as a function argument when adding Vite plugins

  • Deprecated

    Add shallow routing to goto and deprecate pushState and replaceState

  • Abort request.signal when the response closes prematurely, via a new response option for getRequest

  • Make $app/paths importable in service workers

  • Pass the project-relative source filename to the preload filter for fonts

  • Preserve page state set through goto(..., { state, persistState: true }) across reloads

  • Reinstate $env/static/private, $env/dynamic/private, $env/static/public, $env/dynamic/public and $app/environment as deprecated aliases for $app/env/private $app/env/public and $app/env

  • Add page and endpoint booleans to $app/manifest's routes, and export a ManifestRoute type

  • $app/service-worker module

  • Resolve paths using the Vite config root option instead of process.cwd() to better support monorepo configurations such as Vitest workspaces

  • Better error logging

  • Add PageRouteId and EndpointRouteId to $app/types

  • Better tsconfig validation

  • Add dirty() property to form fields

  • Support the QUERY HTTP method in +server.js

  • Allow adapters to override getRequest and setResponse during vite dev and vite preview

  • Deprecated

    Deprecate Response helpers in favor of platform-provided alternatives

  • Add cookies.parse method

  • Deprecated

    Deprecate export const snapshot in favour of the snapshot helper

  • Add snapshot helper to $app/navigation

  • Support custom values in page.state via transport hook

  • Default cookies to secure to false during development

  • Warn when naively proxying requests that result in responses with a content-encoding header

  • Accept the checked state as a third argument to .as('radio', ...) and .as('checkbox', ...) so that these inputs reset to it after a submission

  • Add an applyReroute helper for adapters that support split serverless function deployments

Patch Changes

  • Prevent scheme-like path segments from causing off-site trailing-slash redirects

  • Persist global app state across module graph reloads

  • Generate valid Path types for routes with optional or rest params, several params in one segment, or escape sequences

  • Coerce values typed into remote form fields, and only apply the default given to .as() until the field is edited

  • Blur focused SVG elements before the DOM update on navigation

  • Support bigint params in server-side route resolution

  • Generate types when dev server starts

  • Allow undefined values to be passed to form field .as(...) where applicable

  • Respect paths.relative during development for client files

  • Validate prerender concurrency

  • Deprecated

    Deprecate builder.rimraf and builder.mkdirp in favour of node:fs methods

  • Manipulate stack trace for errors that happen while generating prerender inputs

  • Don't treat callable standard schemas as function param matchers

  • Prevent non-redirect enhanced form results from navigating to another origin

  • Clarify circular imports from src/env

  • Keep memory flat when precompressing many files

  • Render remote form actions while prerendering

  • Ignore Vitest browser loader HTML transforms

  • Prevent failed link preloads from causing unhandled promise rejections in production

  • Resolve generated rootDirs from the project root

  • Generate route resolution modules as siblings of .html pages

  • Parse large streamed frames in linear time

  • Keep at most one pending body read at a time when deserializing binary forms

  • Escape cache-control headers in prerendered HTML

  • Decode all numeric character references, including above ffff, when crawling prerendered pages

  • Enforce request body size limits when Content-Type is absent

  • Include queries refreshed from within another query in the serialized response

  • Reject malformed streamed data encoding

  • Cache the default cookie header parse and avoid allocations in cookies.get

  • Exclude deleted cookies from cookies.getAll() so it stays consistent with cookies.get()

  • Hide stack traces for internal errors like 404s

  • Render the nearest error page when a form submission receives a non-ActionResult error response

  • Correctly implement Vite plugin hook filters

  • Ignore nested outDir files outside generated

  • Defer query.refresh() in server commands until after the command body completes

  • Drain unconsumed request bodies so keep-alive connections don't hang

  • Keep history.scrollRestoration set to manual when leaving the page, so a document restored from the back/forward cache does not fall back to browser scroll restoration

  • Resolve service worker and tsconfig.json based on Vite root setting

  • Rebuild the dev manifest when route files disappear during an incremental update

  • Breaking

    Populate env vars before instrumentation.server.js is evaluated and update the adapter instrumentation API

  • Only print prerender progress newline when necessary

  • Match only unpaired surrogates when escaping HTML

  • Treat data: protocol URLs as external for redirect

  • Don't treat Object.prototype members as param matchers during validation

  • Generate a never Path type when there are no routes

  • Follow HTTP redirects from authentication proxies when enhancing form submissions

  • Don't report empty environment variables as missing

  • Externalize @opentelemetry/api to prevent bundler chunk colocation between instrumentation.server.js and application code

  • Support form fields named after Object prototype properties

  • Exclude routes without a page or endpoint from routes in $app/manifest, and remove directories with no route files from LayoutParams

  • Record a history traversal before resolving its route

  • Avoid Vite dev server reload on initial page request

  • Don't set a null accept-language header on internal fetch sub-requests when the incoming request has none

  • Reuse SSR-cached fetch responses during hydration when a cross-origin URL is not in canonical form

  • Correctly detect prerendered paths in server fetch when paths.base is set

  • Populate $app/env/* dynamic variables in contexts that don't run the dev server, such as vite-node

  • Resolve client manifest imports against the Vite root

  • Properly handle Date objects in form.fields.set

  • Return 404 for form actions and remote functions whose name is an Object.prototype member

  • No longer throw "An impossible situation occurred" when a server-only module is imported by both server and client code

  • Respect Vite default log level

  • Set the focus starting point without a fragment navigation, which leaked a hashchange to app listeners

  • Keep a form.for instance registered when the derived that holds it disconnects and reconnects

  • Make cookie options optional

  • Don't duplicate remote modules in the generated manifest

  • Evict hashed fetch cache entries after mutations

  • Explain the removal of $lib and $service-worker when their imports fail to resolve

  • Tweak response logging for remote requests

  • Correctly massage stack traces with async frames

  • Mark RequestEvent properties as readonly

  • Render the nearest +error.svelte at the depth it occupies when an error is thrown during rendering

  • Support coordinate objects from image inputs in remote forms

  • Revert route metadata caching to regenerate missing root-route types during sync

  • Update match parameter type

  • Generate sourcemaps for remote modules

  • Keep hash-router links on the current document when resolving paths

  • Avoid empty getElementById() call on hash routing navigation

  • Resolve every module entry point using kit.moduleExtensions

  • Serve .ico files with image/x-icon Content-Type

  • Exclude inlined files from the page's $app/manifest immutable list

  • Discard invalidation results when a navigation completes while they load

  • Avoid client-side code being bundled by Cloudflare Wrangler

  • Wait for the redirect navigation before remote form submissions resolve

  • Record the mime types of prerendered paths in the server manifest

  • Only require the svelte-trusted-html trusted-types policy when client-side code is shipped, allowing builds where all pages have csr: false

  • Yield to allow prerender updates to be visible

  • Make paths.origin type looser

  • Send periodic keep-alive SSE comments from query.live to prevent idle-timeout errors

  • Send an explicit SSE Accept header for query.live requests to avoid buffering by proxies

  • Don't touch the query.live stream controller after teardown, and make response cancellation observable via the generator's request.signal

  • Print builder.log.warn messages to stderr, as documented

  • Warn if hook files are spelled as "hook" instead of "hooks"

  • Only suggest a + prefix for route filenames that are valid with the file's extension

  • Don't throw from remote form validate() if the form unmounts while it is waiting for a tick

  • Route dev-server response logging through Vite's logger so it respects logLevel and customLogger

  • Skip clean fields when programmatically validating forms

  • Skip import graph collection outside client environments

  • Breaking

    Experimental remote form validate({ includeUntouched }) option is now all

  • Rerun load functions when the number of values of a tracked search parameter changes

  • Avoid client build warning about externalising node:async_hooks

  • Reinstate $app/environment as an alias for $app/env, in case dependencies import it

  • Preserve paths.base when vite preview redirects a prerendered page to the correct trailing slash

  • Error when reading non-serialized set-cookie headers via getSetCookie in load

  • Walk and copy directories without a stat per file

  • Avoid quadratic remote form issue merging

  • Widen remote form fields for union schemas and string enums

  • Deprecated

    Deprecate the alias option

  • Don't attempt to serialize fetch responses when the request body is not a string or TypedArray

  • Respond to HEAD requests without a body

  • Handle rejected streamed server data after delayed loads

  • Don't crash on interactions inside a form whose controls shadow nodeName

  • Don't replay a preloaded redirect when a later hop of the navigation returns to the route

  • Security

    Prevent path traversal when previewing prerendered pages and data on Windows

  • Settle a query's pending request in place when its value arrives through set()

  • Render pages over sibling endpoints without GET or HEAD handlers

  • Exit build workers after completing their tasks while allowing synchronous exit handlers to run

  • Prevent infinite loops when server-side queries refresh each other in a cycle during the single-flight drain

  • Populate version in service workers

  • Add field.touched() helper to remote form fields

  • Respect paths.relative for server-side route resolution imports

  • Read the error status of App.Error in the prerender and query.live remote functions

  • Resolve remote modules as external during dev prebundling so packages can re-export remote functions

  • Avoid Promise.withResolvers in client remote functions for older browser support

  • Propagate errors from prerendered remote responses instead of re-running the function

  • Allow reserved words (e.g. delete, class) as remote function export names

  • Reset failed <svelte:boundary> on client navigation so a stale +error.svelte is torn down

  • Clear navigating when a shallow popstate aborts an in-flight navigation

  • Expand [x+nn] and [u+nnnn] escape sequences when resolving a route id to a pathname

  • Respect user-set server.cors and preview.cors config instead of overriding them

  • Respect the status returned from handleError on the fallback error page served to error-page sub-requests

  • Restore scroll position after back-forward cache returns

  • Warn if there are plugins using transformIndexHtml

  • Refetch route-tracking server data when navigating away from an error page

  • Allow routes to contain [ and ] via the [x+5b] and [x+5d] escapes

  • Recommend safe include and exclude patterns in tsconfig warning

  • Prevent server-side self-fetch fallbacks from following redirects

  • Serialize query(...).set(...)/query(...).refresh() values into the rendered HTML when called from within a query during SSR

  • Deprecated

    Configure the server runtime in one place, deprecate Server in favour of the server object written by builder.generateServerInstance

  • Correctly read zero-length files at the end of a binary form payload

  • Reject fallback handlers on prerendered endpoints

  • Don't destroy partial-line app output with the prerender progress line

  • Surface prerender errors during development

  • Detect $app/server and $app/env/private client imports when SvelteKit is installed inside the project root

  • Wait for the redirect navigation before prerendered remote functions resolve

  • Sort directory entries when building the route manifest so node indices are deterministic across runtimes (e.g. Bun and Node)

  • Skip unnecessary version.json checks if updated.current is already true

  • Allow generation of $app/tsconfig without TypeScript installed

  • Fall back to the page's form actions when a sibling endpoint has no POST handler

  • Record client output extensions in builder.mimeTypes

  • Use a Set to check element ids when validating fragment links during prerendering

  • Preserve shared client chunk hashes when the app version changes

  • Include hoisted packages in Vite's server.fs.allow list

  • Preserve metadata on streamed page responses

  • Only include _app/immutable files in $app/manifest's immutable in the service worker

  • Atomically replace route metadata during sync

  • Import resolved peer dependencies as file URLs so project-relative resolution works on Windows

  • Preserve sourcemap source paths when adapters copy build output

  • Log errors caught by the Vite dev server handler

  • Resolve root per instance of the SvelteKit Vite plugin

  • Report tsconfig parse errors on Windows

  • Return root layout server data for error-page data requests to non-existent routes

  • Prevent prerender crawler from hanging on unterminated unquoted attributes

  • Prevent await_reactivity_loss warning and state_unsafe_mutation error when the new version detector runs after an await

  • Redact nested and typed underscore-prefixed remote form fields after invalid submissions

  • Ignore path casing differences when warning about overridden Vite config on Windows

  • Return a lightweight 404 instead of rendering the error page for subresource requests

  • Preserve stripped path prefixes by making trailing-slash redirects relative

  • Preserve the current URL search parameters when submitting a remote form without JavaScript

  • Only treat files in node_modules as remote modules when the package has a peer dependency on @sveltejs/kit

  • Treeshake prerendered remote functions in the right chunks

  • Correctly serialize Node.js buffers returned from remote functions during SSR

  • Preserve errors with read-only stack properties

  • Avoid infinite loop when building with --watch flag

  • Error during development if the adapter does not support instrumentation and it exists

  • Use mouseover+mousemove for preloading to reduce events

  • Reject invalid binary form file metadata

  • Error on server-only imports reachable from hooks or service worker files outside the project root

  • Write generated tsconfig to node_modules/$app/tsconfig.json so that tools with simplified tsconfig resolution can find it

  • More informative error message when running a command inside a query or prerender function

  • Adjust error overload for optional App.Error parameters

  • Prerender and crawl pages whose content-type header carries a charset parameter

  • Stream promised read results lazily instead of eagerly buffering them

  • Copy worker files emitted by the server build to the client output directory

  • Correctly decode [u+nnnn] escape sequences above ffff

  • Reject all pending query promises when a query fails before resolving with a value for the first time

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.