SvelteKit 3 has entered Release Candidate phase, bringing breaking changes from SvelteKit 2 alongside a migration tool (sv migrate). Key changes include moving configuration into vite.config.ts, replacing the $lib alias with Node subpath imports (#lib), simplified TypeScript config via $app/tsconfig, reworked service worker imports, more powerful explicit environment variables (now stable, not experimental), improved error handling via Svelte 5 error boundaries and handleError, sourcemapped stack traces, and shallow routing now handled through goto. SvelteKit 3 requires Vite 8 (with Rolldown for faster builds) and adopts the Vite Environment API, though it does not support FetchableDevEnvironment. Remote functions, previewed over the past year, remain experimental but are positioned as the future of client-server communication alongside async Svelte.

6m read timeFrom svelte.dev
Post cover image
Table of contents
What’s changed?Vite 8: Rolldown, and the Environment APIRemote functionsSend us your feedback

Questions this post answers

What are the breaking changes when upgrading from SvelteKit 2 to SvelteKit 3?

SvelteKit 3 moves configuration from svelte.config.js into vite.config.ts, replaces the $lib alias with Node subpath imports using #lib, requires Vite 8 instead of just supporting it, requires Svelte 5, changes tsconfig.json to extend $app/tsconfig instead of ./.svelte-kit/tsconfig.json, and replaces pushState/replaceState shallow routing with goto using a shallow true option. Run npx sv@next migrate sveltekit-3 to automate most of the migration. daily.dev tracks framework breaking changes like this so upgrades don't catch teams off guard.

How do I migrate my SvelteKit 2 app to SvelteKit 3?

Run npx sv@next migrate sveltekit-3 --tasks all --confirm to automatically migrate as much code as possible; anything it cannot handle gets added to a generated TODO list, and SvelteKit prints diagnostic warnings for code that still needs updating. The full migration guide is published at next.svelte.dev/docs/kit/migrating-to-sveltekit-3. developers planning a sveltekit upgrade can follow migration guidance like this on daily.dev.

Why did SvelteKit replace the $lib alias with #lib in version 3?

SvelteKit 3 drops the custom $lib alias in favor of Node's native subpath imports feature, which is already supported by Vite and TypeScript, letting the team remove code that previously coordinated between the tools. The tradeoff is that subpath imports must be unambiguous, so imports need explicit extensions like #lib/foo.ts or #lib/foo/index.ts instead of #lib/foo. daily.dev helps developers weighing framework convention changes like this stay current on the tradeoffs.

363.5K Impressions5 Comments