Next.js guide
Next.js error tracking
Errilo receives your Next.js errors from the official @sentry/nextjs SDK: route handlers, server rendering 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 route handlers (
app/api/…/route.ts). - Errors during server rendering, including client components rendered on the server, through
onRequestError. - Errors in the browser, uncaught or reported with
Sentry.captureException().
Our compatibility suite builds a Next.js 15 app with the App Router, starts it in production mode and checks that each of these errors reaches Errilo, for every SDK version listed below.
Setup
These are the files from Sentry’s setup for Next.js. If you already have them, keep them as they are.
import * as Sentry from "@sentry/nextjs";
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
await import("./sentry.server.config");
}
}
export const onRequestError = Sentry.captureRequestError;Without onRequestError, errors during server rendering never reach Errilo: our suite checks it.
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.SENTRY_DSN,
});import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
});// SDK 9: require("@sentry/nextjs")
const { withSentryConfig } = require("@sentry/nextjs/config");
module.exports = withSentryConfig({
// your Next.js config
});Then set the DSN of your Errilo project:
SENTRY_DSN=https://<key>@ingest.errilo.com/<project>
NEXT_PUBLIC_SENTRY_DSN=https://<key>@ingest.errilo.com/<project>The browser DSN is inlined in the bundle at build time (NEXT_PUBLIC_ variable): rebuild after changing it. The server DSN is read at runtime.
Readable stack traces
In development: source map upload and readable stack traces will be ready for the private beta.
withSentryConfig 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/nextjs@9.47.2 |
| v10 | @sentry/nextjs@10.78.0 |
| v11 | @sentry/nextjs@11.12.0 |
With Next.js 15 and the App Router. Not covered by our suite yet: the edge runtime (middleware, edge route handlers) and the Pages Router.