@sveltejs/kit
3.1.0 · 14 Oct 2026MIT2M / weekRepositoryHomepagenpmAtom feed
389 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 3.x · latest line
3.1.0
14 Oct 2026support
report-sha256/report-sha384/report-sha512CSP hash-reporting keywordsemit a
sveltekit.endpointspan for+serverhandlers when server tracing is enableddon't treat every module as server-only when the project is inside a
serverdirectory
Minor Changes
support
report-sha256/report-sha384/report-sha512CSP hash-reporting keywordsemit a
sveltekit.endpointspan for+serverhandlers when server tracing is enabled
Patch Changes
don't treat every module as server-only when the project is inside a
serverdirectorycontinue deployment recovery when service worker updates fail
infer prerendered MIME types from generated files
leave generated files alone when their contents are unchanged
leave focus in the parent page when an app in an unfocused iframe starts or navigates
don't warn about Storybook's Vite plugins that use
transformIndexHtml
3.0.1
6 Oct 2026ensure relative imports in generated types work with
nodenextmodule resolution
3.0.0
1 Oct 2026- breaking
move remote function types to
$app/server - breaking
remove
experimental.handleRenderingErrorsflag - breaking
make
getRequestandsetResponsesynchronous
Major Changes
- breaking
move remote function types to
$app/server - breaking
remove
experimental.handleRenderingErrorsflag - breaking
make
getRequestandsetResponsesynchronous - 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
cookiev2. 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
preloadStrategyoption.modulepreloadwill always be used - breaking
default the cookie
pathoption to'/' - breaking
remove
@sveltejs/kit/node/polyfills - breaking
add
config.kit.output.linkHeaderPreloadto preload using theLinkheader - breaking
require
@sveltejs/vite-plugin-sveltev7 - breaking
make
page.urlimmutable on a type level - breaking
remove
base,assets, andresolveRoutefrom$app/paths - breaking
remove
createEntriesfrom theBuilderobject passed to adapter functions - breaking
return no content for 204 responses
- breaking
rename
Pathnametype toPathandAssettoAssetPath
breaking: remove leading/fromPathandAssetPath - breaking
handle'sresolveis now typed to always return aPromise - breaking
remove
Serverconstructor andSSRManifestfrom 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
defineParamsand associated types to@sveltejs/kit/params - breaking
remove the deprecated CSRF
checkOriginoption in favor oftrustedOrigins - breaking
the
deltaproperty now only exists forpopstatenavigation events - breaking
change
form.errortype fromanytoApp.Error | undefined - breaking
remove deprecated
pragmaheader in version polling for improved CORS support - breaking
gotonow 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
handleErrorhook - breaking
require Svelte 5.56.4 or newer
- breaking
error on
event.url,event.paramsandevent.routeaccess 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-workermodule - breaking
move
defineEnvVarsto@sveltejs/kit/env - breaking
nested server-only directories
- breaking
allow adapters to provide additional Vite plugins
- breaking
replace the
$libalias with#liband removefiles.libconfig. - breaking
remove
#libdefinition frompaths; requires explicit module extensions as a result - breaking
change
error,isHttpError,redirect, andisRedirectto 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.pollIntervalto 1 hour - breaking
disallow cross-origin form submissions without a
Content-Typeheader - breaking
Server-only directories (
/server/in the path) are now treated as server-only everywhere inside the project (exceptsrc/routesand the assets directory) - breaking
configexported 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 offalse - breaking
move tracing out of the experimental namespace and remove the instrumentation flag
- breaking
add
kit.paths.originconfig option, removekit.prerender.originand theadapter-nodeORIGINenvironment variable - breaking
move
Page,ReadonlyURLandReadonlyURLSearchParamsfrom@sveltejs/kitto$app/state - breaking
remove
$app/stores - breaking
add
refreshAlland deprecateinvalidateAll - breaking
reject query parameters beginning with
x-sveltekit- - breaking
disallow
*.remote.ts/jsfiles unlessexperimental.remoteFunctionsis enabled - breaking
replace the
noScrollandkeepFocusoptions ofgotowith a singleresetoption, and thedata-sveltekit-noscrollanddata-sveltekit-keepfocusattributes withdata-sveltekit-reset - breaking
don't abort navigation when calling
invalidate(All)during navigation - breaking
consistent special filename patterns
- breaking
allow
handleErrorto 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 stablerolldown1.0.0 - breaking
only include routes with a
+pageor+serverinRouteId - breaking
require Node 22.17
- breaking
deprecate
error(status, {...})in favour oferror(status, message, {...}) - breaking
replace the
builder.generateManifestwithbuilder.generateServerInstanceandbuilder.manifest - breaking
forbid external redirects by default
- breaking
separate adapter Vite plugins into
preandpost - breaking
remove param files in folder in favor of
params.js/tsfile - breaking
move env-related types to
@sveltejs/kit/env - breaking
preloadCodenow takes a route ID (e.g./blog/[slug]) instead of a pathname. Route IDs are not prefixed withpaths.base - breaking
move
BeforeNavigate,OnNavigate,AfterNavigate,Navigation,NavigationTarget,NavigationType,GotoOptionsand theNavigation*variant types from@sveltejs/kitto$app/navigation - breaking
move
ActionResultandSubmitFunctionfrom@sveltejs/kitto$app/forms - breaking
remove
handleValidationErrorand pass remote function validation errors tohandleErrorwithkind: 'validation' - breaking
remove deprecated
.run()method from live queries
Minor Changes
allow hyphens in param and matcher names
add
$app/manifestmodule withimmutable,assets,prerendered, androutesexportsignore files with + prefix if they contain test/spec/stories
add
ErrorPropsto generated typessupport sourcemaps in production
return the list of compressed files from
builder.compressbetter 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 registrationsallow adapters to receive the Svelte config as a function argument when adding Vite plugins
- deprecated
add shallow routing to
gotoand deprecatepushStateandreplaceState abort
request.signalwhen the response closes prematurely, via a newresponseoption forgetRequestmake
$app/pathsimportable in service workerspass the project-relative source
filenameto thepreloadfilter for fontspreserve page state set through
goto(..., { state, persistState: true })across reloadsreinstate
$env/static/private,$env/dynamic/private,$env/static/public,$env/dynamic/publicand$app/environmentas deprecated aliases for$app/env/private$app/env/publicand$app/envadd
pageandendpointbooleans to$app/manifest'sroutes, and export aManifestRoutetype$app/service-workermoduleresolve paths using the Vite config
rootoption instead ofprocess.cwd()to better support monorepo configurations such as Vitest workspacesbetter error logging
add
PageRouteIdandEndpointRouteIdto$app/typesbetter tsconfig validation
add
dirty()property to form fieldssupport the
QUERYHTTP method in+server.jsallow adapters to override
getRequestandsetResponseduringvite devandvite previewadd
cookies.parsemethodadd
snapshothelper to$app/navigationsupport custom values in
page.stateviatransporthookdefault cookies to
securetofalseduring developmentwarn when naively proxying requests that result in responses with a
content-encodingheaderaccept the checked state as a third argument to
.as('radio', ...)and.as('checkbox', ...)so that these inputs reset to it after a submissionadd an
applyReroutehelper 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
Pathtypes for routes with optional or rest params, several params in one segment, or escape sequencescoerce values typed into remote form fields, and only apply the default given to
.as()until the field is editedblur focused SVG elements before the DOM update on navigation
support bigint params in server-side route resolution
generate types when dev server starts
allow
undefinedvalues to be passed to form field.as(...)where applicablerespect
paths.relativeduring development for client filesvalidate prerender concurrency
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/envkeep 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
.htmlpagesparse 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 pagesenforce 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.getexclude deleted cookies from
cookies.getAll()so it stays consistent withcookies.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 completesdrain unconsumed request bodies so keep-alive connections don't hang
keep
history.scrollRestorationset tomanualwhen leaving the page, so a document restored from the back/forward cache does not fall back to browser scroll restorationresolve service worker and
tsconfig.jsonbased on Viterootsettingrebuild the dev manifest when route files disappear during an incremental update
- breaking
populate env vars before
instrumentation.server.jsis 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 redirectdon't treat
Object.prototypemembers as param matchers during validationgenerate a
neverPathtype when there are no routesfollow HTTP redirects from authentication proxies when enhancing form submissions
don't report empty environment variables as missing
externalize
@opentelemetry/apito prevent bundler chunk colocation betweeninstrumentation.server.jsand application codesupport form fields named after Object prototype properties
exclude routes without a page or endpoint from
routesin$app/manifest, and remove directories with no route files fromLayoutParamsrecord a history traversal before resolving its route
avoid Vite dev server reload on initial page request
don't set a
nullaccept-languageheader on internalfetchsub-requests when the incoming request has nonereuse SSR-cached fetch responses during hydration when a cross-origin URL is not in canonical form
correctly detect prerendered paths in server
fetchwhenpaths.baseis setpopulate
$app/env/*dynamic variables in contexts that don't run the dev server, such asvite-noderesolve 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.prototypememberno 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
hashchangeto app listenerskeep a
form.forinstance registered when the derived that holds it disconnects and reconnectsmake cookie options optional
don't duplicate remote modules in the generated manifest
evict hashed fetch cache entries after mutations
explain the removal of
$liband$service-workerwhen their imports fail to resolvetweak response logging for remote requests
correctly massage stack traces with async frames
mark
RequestEventproperties asreadonlyrender the nearest
+error.svelteat the depth it occupies when an error is thrown during renderingsupport coordinate objects from image inputs in remote forms
revert route metadata caching to regenerate missing root-route types during sync
update
matchparameter typegenerate 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.moduleExtensionsserve
.icofiles withimage/x-iconContent-Typeexclude inlined files from the page's
$app/manifestimmutable listdiscard 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-htmltrusted-types policy when client-side code is shipped, allowing builds where all pages havecsr: falseyield to allow prerender updates to be visible
make
paths.origintype loosersend periodic
keep-aliveSSE comments fromquery.liveto prevent idle-timeout errorssend an explicit SSE Accept header for
query.liverequests to avoid buffering by proxiesdon't touch the
query.livestream controller after teardown, and make response cancellation observable via the generator'srequest.signalprint
builder.log.warnmessages to stderr, as documentedwarn if hook files are spelled as "hook" instead of "hooks"
only suggest a
+prefix for route filenames that are valid with the file's extensiondon't throw from remote form
validate()if the form unmounts while it is waiting for a tickroute dev-server response logging through Vite's logger so it respects
logLevelandcustomLoggerskip clean fields when programmatically validating forms
skip import graph collection outside client environments
- breaking
experimental remote form
validate({ includeUntouched })option is nowall rerun load functions when the number of values of a tracked search parameter changes
avoid client build warning about externalising
node:async_hooksreinstate
$app/environmentas an alias for$app/env, in case dependencies import itpreserve
paths.basewhenvite previewredirects a prerendered page to the correct trailing slasherror when reading non-serialized
set-cookieheaders viagetSetCookieinloadwalk and copy directories without a stat per file
avoid quadratic remote form issue merging
widen remote form fields for union schemas and string enums
don't attempt to serialize fetch responses when the request body is not a string or TypedArray
respond to
HEADrequests without a bodyhandle rejected streamed server data after delayed loads
don't crash on interactions inside a form whose controls shadow
nodeNamedon'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
versionin service workersadd field.touched() helper to remote form fields
respect
paths.relativefor server-side route resolution importsread the error status of
App.Errorin theprerenderandquery.liveremote functionsresolve remote modules as external during dev prebundling so packages can re-export remote functions
avoid
Promise.withResolversin client remote functions for older browser supportpropagate errors from prerendered remote responses instead of re-running the function
allow reserved words (e.g.
delete,class) as remote function export namesreset failed
<svelte:boundary>on client navigation so a stale+error.svelteis torn downclear
navigatingwhen a shallow popstate aborts an in-flight navigationexpand
[x+nn]and[u+nnnn]escape sequences when resolving a route id to a pathnamerespect user-set
server.corsandpreview.corsconfig instead of overriding themrespect the status returned from
handleErroron the fallback error page served to error-page sub-requestsrestore scroll position after back-forward cache returns
warn if there are plugins using
transformIndexHtmlrefetch route-tracking server data when navigating away from an error page
allow routes to contain
[and]via the[x+5b]and[x+5d]escapesrecommend 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 SSRcorrectly 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/serverand$app/env/privateclient imports when SvelteKit is installed inside the project rootwait 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.jsonchecks ifupdated.currentis alreadytrueallow 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.mimeTypesuse a
Setto check element ids when validating fragment links during prerenderingpreserve shared client chunk hashes when the app version changes
include hoisted packages in Vite's
server.fs.allowlistpreserve metadata on streamed page responses
only include
_app/immutablefiles in$app/manifest'simmutablein the service workeratomically 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
rootper instance of the SvelteKit Vite pluginreport 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_losswarning andstate_unsafe_mutationerror when the new version detector runs after anawaitredact 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
--watchflagerror 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.jsonso that tools with simplified tsconfig resolution can find itmore informative error message when running a command inside a query or prerender function
adjust error overload for optional
App.Errorparametersprerender and crawl pages whose
content-typeheader carries acharsetparameterstream promised
readresults lazily instead of eagerly buffering themcopy worker files emitted by the server build to the client output directory
correctly decode
[u+nnnn]escape sequences aboveffffReject all pending query promises when a query fails before resolving with a value for the first time
- 2.x
2.70.3
18 Aug 2026avoid eagerly reading
$app/statedependencies during module initialization
2.70.2
29 Jul 2026prevent quadratic backtracking in
Acceptheader content negotiation
2.49.1 – 2.70.145 releases with no change for you1 maintenance, 44 without a noteShow each
- 2.70.119 Jul 2026docs, tests or tooling
- 2.70.017 Jul 2026no note
- 2.69.313 Jul 2026no note
- 2.69.28 Jul 2026no note
- 2.69.12 Jul 2026no note
- 2.69.01 Jul 2026no note
- 2.68.024 Jun 2026no note
- 2.67.022 Jun 2026no note
- 2.66.018 Jun 2026no note
- 2.65.216 Jun 2026no note
- 2.65.114 Jun 2026no note
- 2.65.011 Jun 2026no note
- 2.64.08 Jun 2026no note
- 2.63.18 Jun 2026no note
- 2.63.04 Jun 2026no note
- 2.62.02 Jun 2026no note
- 2.61.124 May 2026no note
- 2.61.022 May 2026no note
- 2.60.114 May 2026no note
- 2.60.014 May 2026no note
- 2.59.15 May 2026no note
- 2.59.01 May 2026no note
- 2.58.023 Apr 2026no note
- 2.57.19 Apr 2026no note
- 2.57.08 Apr 2026no note
- 2.56.13 Apr 2026no note
- 2.56.03 Apr 2026no note
- 2.55.012 Mar 2026no note
- 2.54.011 Mar 2026no note
- 2.53.428 Feb 2026no note
- 2.53.326 Feb 2026no note
- 2.53.225 Feb 2026no note
- 2.53.124 Feb 2026no note
- 2.53.020 Feb 2026no note
- 2.52.218 Feb 2026no note
- 2.52.015 Feb 2026no note
- 2.51.012 Feb 2026no note
- 2.50.22 Feb 2026no note
- 2.50.123 Jan 2026no note
- 2.50.017 Jan 2026no note
- 2.49.515 Jan 2026no note
- 2.49.49 Jan 2026no note
- 2.49.35 Jan 2026no note
- 2.49.28 Dec 2025no note
- 2.49.12 Dec 2025no note