Skip to content
chornous.dev

Type two or more letters. Esc closes.

Index of sheets
Theme

Sheet 03 · Writing

All notes

Next.js 16.1: a disk cache for next dev, a bundle analyzer and next dev --inspect

Next.js 16.1 shipped on December 18, 2025. Turbopack's file system cache for next dev is stable and on by default, cutting a large Vercel app's first route compile from 15 s to 1.1 s. It also adds an experimental bundle analyzer, next dev --inspect and transitive serverExternalPackages.

Pl. 12 · pipeline drawing generated from the slug “nextjs-16-1-turbopack-cache-debugging”

Luke Sandberg and Tim Neutkens announced Next.js 16.1 on December 18, 2025. The release targets the waits you hit many times a day: restarting the dev server, finding out why a bundle is heavy, and attaching a debugger. Each one gets a fix.

The dev server remembers

Turbopack now writes its compiler artifacts to disk during next dev. Restart the server and it reads them back instead of compiling from scratch. The cache is stable in 16.1 and on by default, so you get it by upgrading.

First route compile after a restart, cold vs. cached, from the Next.js team
AppColdCachedSpeedup
react.dev3.7 s380 ms~10x
nextjs.org3.5 s700 ms~5x
Large internal Vercel app15 s1.1 s~14x

The bigger the app, the bigger the win. A 15-second wait after each restart is long enough to open Slack and lose your train of thought. At 1.1 seconds you stay in the editor.

Vercel ran this cache on internal apps for a year before calling it stable. Luke Sandberg's Next.js Conf talk explains how it works. The team plans to stabilize the same cache for next build next, which would carry the speedup into CI.

One side effect: the team simplified the caching layer enough to make Next.js installs about 20 MB smaller.

A bundle analyzer that knows about Server Components

The experimental analyzer runs on Turbopack builds:

next experimental-analyze

It opens an interactive treemap of your production bundles. You can filter by route, switch between client and server views, and see CSS and asset sizes. The useful part is the import chain: click a module and it shows why it's in the bundle, including the hop across a server-to-client boundary or a dynamic import.

That answers the question older analyzers left open. You knew moment sat in your client bundle, and you didn't know which "use client" file pulled it in. Vercel hosts a demo of the analyzer if you want to try it before upgrading.

Smaller server bundles also mean faster cold starts on serverless functions, which the team calls out next to Core Web Vitals.

Debugging without NODE_OPTIONS

Before 16.1, you attached Node's debugger with NODE_OPTIONS=--inspect. That attached the inspector to each process Next.js spawned, so you fought over ports and picked the right target by trial and error. Now:

next dev --inspect

The flag attaches the inspector to the process that runs your code. Open chrome://inspect or attach VS Code, set a breakpoint in a route handler or a Server Component, and step through it.

serverExternalPackages works for transitive dependencies

serverExternalPackages keeps a dependency out of the server bundle, which you need for native modules such as sqlite. Before 16.1 it only worked well for direct dependencies. If a library you use depended on sqlite, you added sqlite to your own package.json to externalize it. That leaked the library's internals into your manifest, and two libraries needing different versions left you stuck.

 // package.json
 "dependencies": {
   "some-orm": "^3.0.0",
-  "sqlite3": "^5.1.7"
 }

Turbopack now resolves and externalizes transitive dependencies on its own. Delete the workaround entries and run a build to confirm.

The smaller items

Other changes in Next.js 16.1
ChangeWhat you get
next upgrade commandOne command for future version bumps
get_routes in the DevTools MCP serverCoding agents can list your app's routes
generateStaticParams timing in dev logsSlow static params show up per request
Worker counts in next build logsSee how many threads build steps use
Fewer async import chunks in devFewer requests on pages with many dynamic imports
Relative source map paths on the serverBetter compatibility with Node and other tools

This week

  1. Upgrade with npx @next/codemod@canary upgrade latest. From here on, next upgrade does the same job.
  2. Time your first route compile after a dev server restart, before and after. If you see no change, check that you run Turbopack and not webpack.
  3. Run next experimental-analyze and open your heaviest route. Note the largest client module and the file that imports it.
  4. Replace NODE_OPTIONS=--inspect in your scripts and docs with next dev --inspect.
  5. Remove transitive packages you added to package.json only for serverExternalPackages.

Volodymyr Chornous