SvelteKit guide
SvelteKit error tracking
Errilo receives your SvelteKit errors from the official @sentry/sveltekit SDK: server routes, load functions and the browser. Already on Sentry? Only the DSN changes.
Errilo is in development. This guide describes the setup our compatibility suite tests today; the private beta opens in summer 2027.
What gets caught
- Errors thrown in server routes (
+server.ts), throughhandleErrorWithSentry, with the request method and URL. - Errors in universal
loadfunctions run in the browser during client-side navigation.
Our compatibility suite builds a SvelteKit 2 app with adapter-node, starts it in production mode and checks that both errors reach Errilo, for every SDK version listed below.
Setup
These are the files from Sentry’s manual setup for SvelteKit. If you already have them, keep them as they are.
import { sentrySvelteKit } from "@sentry/sveltekit/vite"; // SDK 9 and 10: "@sentry/sveltekit"
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [sentrySvelteKit(), sveltekit()],
});The Sentry plugin goes before sveltekit().
import * as Sentry from "@sentry/sveltekit";
Sentry.init({ dsn: process.env.SENTRY_DSN });
export const handle = Sentry.sentryHandle();
export const handleError = Sentry.handleErrorWithSentry();import * as Sentry from "@sentry/sveltekit";
import { env } from "$env/dynamic/public";
Sentry.init({ dsn: env.PUBLIC_SENTRY_DSN });
export const handleError = Sentry.handleErrorWithSentry();Then set the DSN of your Errilo project. Both are read at runtime: no rebuild needed to change them.
SENTRY_DSN=https://<key>@ingest.errilo.com/<project>
PUBLIC_SENTRY_DSN=https://<key>@ingest.errilo.com/<project>Readable stack traces
In development: source map upload and readable stack traces will be ready for the private beta.
The sentrySvelteKit Vite plugin uploads your source maps at build time. Errilo implements the same upload API: give the plugin Errilo’s address and an Errilo token, and stack traces point to your TypeScript source instead of the compiled code. See the migration guide.
Tested versions
| Major version | Tested version |
|---|---|
| v9 | @sentry/sveltekit@9.47.2 |
| v10 | @sentry/sveltekit@10.78.0 |
| v11 | @sentry/sveltekit@11.12.0 |
With SvelteKit 2, Svelte 5 and adapter-node. Not covered by our suite yet: the other adapters (Vercel, Cloudflare, Netlify).