Next.js 15.1 — React 19, improved debugging, after() and auth APIs
Key Points
- React 19 stable support
- after() stabilized for post-response tasks
- Experimental forbidden()/unauthorized() APIs
Summary
Next.js 15.1 adds stable React 19 support, improved developer debugging (better source maps, collapsed stack frames, consistent Edge runtime errors), the stable after() API for post-response work, and two experimental authorization helpers (forbidden() and unauthorized()). Turbopack is now stable and recommended for more accurate source maps and profiling.
Key Points
-
React 19
- Pages Router: official React 19 stable support (React 18 still supported).
- App Router: continues to ship with React canary builds to validate new framework integrations.
-
Improved error debugging
- Better source maps with ignoreList support to hide external dependency frames.
- Collapsed stack frames in the browser overlay and terminal; "Show ignored frames" reveals hidden frames.
- Consistent error output and profiling in the Edge runtime.
-
after() (stable)
- Run non-blocking secondary work after a response finishes streaming (logging, analytics, sync tasks).
- Now supports self-hosted servers, runtime APIs (cookies(), headers()), and extensibility for platform waitUntil() implementations.
- Usage: import { after } from 'next/server'; after(() => { /* secondary task */ });
-
forbidden()/unauthorized() (experimental)
- New helper APIs to trigger 403/401 flows and provide customizable pages at app/forbidden.tsx and app/unauthorized.tsx.
- Enable via next.config.ts: { experimental: { authInterrupts: true } }.
- Note: if triggered after response headers are sent, the status code will be 200 (same behavior as notFound()).
-
Upgrade notes & quick commands
- Automated: npx @next/codemod@canary upgrade latest
- Manual: npm install next@latest react@latest react-dom@latest
- New project: npx create-next-app@latest
-
Miscellaneous
- Turbopack is stable — recommended for better source-map/method-name mapping and profiling.
- Several small fixes and features: ESLint 9 in create-next-app, increased cache tags, CSS inlining option, and multiple bug fixes affecting rewrites, server actions, and routing.
Actionable guidance
- Upgrade to Next.js 15.1 and React 19 if you use the Pages Router; test App Router behavior with the built-in canary where needed.
- Adopt Turbopack for improved source-mapping and profiling when possible.
- Populate ignoreList in library sourcemaps to improve consumer debugging.
- Enable experimental authInterrupts to evaluate forbidden()/unauthorized() and provide custom error pages during development.