JavaScript

How to Master Database Indexing for Faster Queries

SvelteKit 3 is here, and it needs more than usual: Node 22, Vite 8, and TypeScript 6. This guide breaks down what each new minimum means, why your whole stack has to move, and how to upgrade without breaking things.

M
Md Shayon
Oct 7, 2026
6 min read
Table of Contents
How to Master Database Indexing for Faster Queries

SvelteKit 3 dropped on October 1, 2026.

If you're planning to upgrade, there's one thing you should know before you touch anything.

This isn't just a framework update. It's a stack update.

SvelteKit 3 needs newer versions of the stuff under it. Node 22. Vite 8. TypeScript 6. If you're running older versions, your upgrade just won't work. Not until you fix those first.

So let's go through what actually changed, and what it means for your project.

The New Minimums

Here's the list. These aren't suggestions. They're required.

Tool

Minimum

What it's for

Node

22+

Runs your server

TypeScript

6+

Type checking, editor stuff

Vite

8.0.12+

Build tool

Svelte

5.56.4+

The UI framework

Svelte Vite Plugin

7

Hooks Svelte into Vite

Vite 8.0.12 is the important one. It's the first Vite 8 release with Rolldown 1.0.0 baked in as stable. Rolldown is a bundler written in Rust. It replaces the old Rollup pipeline. That's where a lot of the "SvelteKit 3 is faster" talk comes from.

Not SvelteKit itself. Vite + Rolldown.

Why This Is More Than a Version Bump

Here's the part most upgrade posts skip.

Changing one line in package.json? Easy. Everything else that has to move with it? Not easy.

Think about it.

If your app runs on Node 18, you can't just upgrade SvelteKit. You gotta upgrade Node on:

That's four different places. Four different owners. Four different test runs.

Now add custom adapters. Add old TypeScript configs. Add hosting setups.

It adds up fast.

Someone over at WebPulse put it well:

"A framework release is free to download. The bill arrives when the stack beneath it has to move."

Yeah. That's the whole thing in one sentence.

Breaking Change #1: Adapters Need Work

If you use a third-party adapter like adapter-netlify, adapter-vercel, or adapter-node — check that they've shipped a SvelteKit 3 version first.

If you wrote your own adapter? You're doing the work yourself.

Two things broke:

  • createEntries was removed from the builder object

  • builder.generateManifest got replaced by two new members

That's how your adapter tells SvelteKit which routes exist and how to build the manifest. So it's not a small thing.

Quick tip: ask your team which adapters are in use. Then check the GitHub for a v3 release. Don't assume it'll just work.

Breaking Change #2: $lib Is Now #lib

Everyone's talking about this one.

Old way:

import { formatDate } from '$lib/utils';

New way:

import { formatDate } from '#lib/utils/index.ts';

Yeah. $lib is gone. It's #lib now.

Why though?

$lib was a SvelteKit-only thing. Vite and TypeScript both had to agree on it. Messy.

#lib uses Node's native subpath imports. You declare it in package.json. Now it works in more places — including server code you might want to run without SvelteKit.

The annoying part

#lib needs file extensions. So this won't work:

import { formatDate } from '#lib/utils';  // nope

You need:

import { formatDate } from '#lib/utils/index.ts';  // yes

If your build blows up with a module resolution error after upgrading, that's probably why. Go look for #lib imports pointing to folders, or missing the extension.

What Rich Harris said

The maintainer was pretty honest about this one. In the original GitHub issue he said he'd "love for everyone to use nodenext" but that "users might revolt" over extensionless imports.

And if you really don't like it? "You can always create your own alias."

Fair enough.

The migration tool rewrites most of these for you. But it won't catch everything.

Breaking Change #3: Config Moves to vite.config.ts

SvelteKit 2 had svelte.config.js. That file's gone.

Now it all lives in vite.config.ts.

Why? Because the Vite plugin can read it right away. Synchronously. No waiting around. In SvelteKit 2, config resolution was async — it couldn't even start until the full Vite config was resolved. Slow and awkward.

That's fixed now.

What it means for you:

  • Migration tool moves your config automatically

  • Vite plugins can read SvelteKit config directly

  • vite.config.ts is now the one place for config

One file. Nice.

What to Know Before Learning Next.js in 2026: A Practical Guide

Breaking Change #4: Security Defaults Flipped

SvelteKit 3 turns a few security things on by default. They used to be opt-in.

Short version:

Thing

Before

Now

External redirects

Allowed

Blocked

Cookie path

Not set

/

CSRF check

checkOrigin

trustedOrigins

x-sveltekit- query params

Allowed

Rejected

The idea is simple. The framework says no first. Want the old behavior? You have to say so in your config.

What this breaks in real life

Say you redirect users to a partner site after login. That worked before. Now it's blocked until you allow it.

Or say your app accepts form posts from a subdomain. Also blocked now. You need to add that origin to trustedOrigins.

Do this: test every flow that

  • redirects somewhere else

  • accepts form posts from another origin

  • sets cookies

If something breaks, now you know why.

Breaking Change #5: Ops Stuff

A few things changed for deployment, not code.

  • kit.paths.origin replaces the ORIGIN env var in adapter-node

  • version.pollInterval now defaults to 1 hour

  • $service-worker is gone — use $app/env, $app/paths, and $app/manifest

If your ops team depends on any of these, they need a heads-up.

How to Actually Migrate

Here's the command:

npx sv migrate sveltekit-3 --tasks all --confirm

It does a lot:

  • rewrites $lib → #lib

  • moves config to vite.config.ts

  • updates tsconfig.json

  • gives you a TODO list for anything it can't do

Your checklist

  1. Check versions. node -v, npx tsc -v, and your package.json for Vite.

  2. Bump Node to 22+ everywhere. Local, CI, servers, Docker.

  3. Bump TypeScript to 6+.

  4. Bump Vite to 8.0.12+.

  5. Bump Svelte to 5.56.4+ and the Vite plugin to 7.

  6. Run the migration command.

  7. Fix #lib imports that point to folders or lack extensions.

  8. Test redirects, cookies, cross-origin forms.

  9. Check your adapters.

  10. Read the full release notes on GitHub. The published list cuts off early.

The Svelte team said it themselves:

"We've made migration as seamless as we can... which will automatically migrate as much of your codebase as possible, and generate a TODO list for everything else."

Translation: it does most of it. You do the rest.

Remote Functions? Not Yet

If you saw "remote functions" and got excited — hold on.

They're not ready. Still behind an experimental flag. Still need Async Svelte.

Team says it's their top priority. But it's not shipping today.

So if remote functions are why you want to upgrade, wait a bit.

Should You Upgrade Right Now?

Depends.

Yeah, go for it if:

  • You're already on Node 22+ and Vite 8

  • No custom adapters

  • You have time to test redirects and forms

  • You want faster Rolldown builds

Hang on if:

  • You're on Node 18 or 20 and can't move yet

  • Your custom adapter isn't updated

  • You lean hard on external redirects and can't test right now

SvelteKit 2 still works. There's no emergency. But if your stack's ready, SvelteKit 3 is a good upgrade. Faster builds. Better types. Less junk.


Tags

# TypeScript 6# SvelteKit breaking changes# $lib to #lib# Rolldown bundler# SvelteKit upgrade guide# SvelteKit 3# SvelteKit 3 requirements
Keep Reading

Related Articles

Continue your learning journey