Updated 3 Nov 2026: SvelteKit 3.1.1 October 29 security-sensitive server-only import and cross-origin path fixes; no CVE/exploitation claim. Maintains original migration dossier.

Key details

  1. SvelteKit 3 became stable October 1, 2026.
  2. svelte.config.js is no longer supported; use Vite plugin configuration.
  3. The $lib alias moves to #lib.
  4. Minimums include Node 22.17, TypeScript 6, Svelte 5.57.1 and Vite 8.0.12.
  5. sv CLI 1.0 provides a SvelteKit 3 migration command and TODO generation.
  6. The project recommends upgrading to the latest 2.x first to receive targeted deprecation warnings.
  7. October 29, 2026: SvelteKit 3.1.1 fixes double-slash cross-origin route resolution and server-only imports through src/params.js.
  8. No CVE or confirmed exploitation was established for the 3.1.1 fixes.

What builders should take away

  1. Upgrade to the latest SvelteKit 2.x before running the official migration command.
  2. Move framework settings into vite.config and check every tool that imports config.
  3. Test routes, server-only modules, environment secrets and deployed adapters after codemods.
  4. Update CI Node/TypeScript/Vite versions and keep a rollback branch.
  5. After migrating to SvelteKit 3, patch to at least 3.1.1 and regression-test path handling, src/params.js, remote forms and adapter-generated routes.

What changed

The Svelte team released SvelteKit 3 on October 1, 2026 alongside sv CLI 1.0. The major removes svelte.config.js in favour of passing SvelteKit configuration through the Vite plugin in vite.config.js, replaces the $lib alias with #lib based on standard subpath imports, removes legacy modules and updates environment/error handling. Minimum dependencies include Node 22.17, TypeScript 6, Svelte 5.57.1 and Vite 8.0.12. The sv migrate sveltekit-3 command handles many mechanical changes and emits TODOs for remaining manual work. On October 29, SvelteKit 3.1.1 added security-sensitive fixes: prevent server-side route resolution from loading code from another origin for pathnames beginning //, and prevent src/params.js from importing server-only modules into browser code. The release also changes remote-form parsing to linear time and includes adapter route-escaping fixes.

Why it matters

A production framework major can affect every build, test and deployment path, not just application syntax. Consolidating configuration with Vite reduces parallel config systems, while standard imports and stricter typing change assumptions in older SvelteKit projects. The CLI migration tool reduces effort but cannot guarantee application semantics or adapter compatibility. Teams that have already migrated to SvelteKit 3 should not treat 3.0 as a final upgrade target: 3.1.1 addresses server/client code separation and path interpretation at request boundaries. The upstream notes do not establish a CVE or successful exploitation, so the implications should not be overstated.

Configuration moves to the Vite plugin

SvelteKit configuration previously stored in svelte.config.js must move to vite.config.js. Tooling that reads or generates the old file needs updating.

Aliases and legacy APIs change

The $lib alias is replaced by #lib, and older app/store and service-worker paths are retired. Migration diagnostics and codemods cover much but not all cases.

Runtime requirements jump

SvelteKit 3 requires Node 22.17, TypeScript 6, Svelte 5.57.1 and Vite 8.0.12 or newer. CI, host images and adapters need version checks.

sv 1.0 supports the migration

The official CLI reached 1.0 and includes a migration command plus an official community add-on API, making scaffolding and upgrades more consistent.

October 29 follow-up: 3.1.1 repairs server/client trust boundaries

SvelteKit 3.1.1 fixes server-side route resolution for pathnames starting with double slashes, which previously could load code from another origin. It also prevents server-only modules from being imported into browser code through src/params.js. Both fixes concern security-sensitive separation, although the upstream release does not assign CVEs or document exploitation. The same release makes remote form parsing linear-time, avoids duplicate query.batch sharing, and includes adapter fixes: Cloudflare's generated _redirects/_routes.json path escaping, Vercel route-pattern escaping and Node text/event-stream immutable-header handling. Teams running 3.0.x or 3.1.0 should update to 3.1.1 or a confirmed later patch, then test routing, params, server-only imports and adapter deployments.

What to watch next

  • Adapter compatibility and post-GA patch releases.
  • Remote functions maturation and broader stable API boundaries.
  • Migration regressions in larger SvelteKit 2 applications.
  • Any maintainer security advisories or follow-up patches clarifying the scope of 3.1.1's trust-boundary fixes.

Still unclear

  • The codemod does not guarantee semantic correctness or complete adapter migration.
  • Some adjacent Svelte remote-function capabilities remain experimental.
  • The release notes do not provide CVEs, exploit prerequisites or confirmed incidents for the 3.1.1 fixes.

Sources

Direct reading behind this dossier.

4 sources
Migrating to SvelteKit v3
SvelteKit primary documentation

Official breaking changes and dependency requirements.

Discussion

Discussion is reader-contributed. Comments are not part of the BTN dossier or its editorial evidence.

0 visible comments

Join the discussion

Keep comments useful and relevant. Reader contributions may be moderated and are not BTN editorial evidence.

Sign in to comment