Skip to content
Stacklumen is now a solutions companySee the list here

Next.js 16.5 is out, and December's security fixes will ship on it

Next.js 16.5 brings faster Turbopack builds, cached data that can survive a redeploy and experimental Go routes. The scheduled security release on 15 December will be on the 16.5.x line, so plan the upgrade now.

Stacklumen blog card reading 'Next.js 16.5 is out', with a timeline from 16.4.x to the 16.5.0 release on 2 December and security fixes on 16.5.x on 15 December, above a list of three changes: 'use cache: remote' kept across deploys, next build --analyze, and experimental Go route handlers.
On this page
  1. Faster builds that use less memory
  2. Cached data can survive a redeploy
  3. Bundle reports from your normal build
  4. Prefetching for one likely link
  5. Scheduled upgrades in CI
  6. Two experimental features
  7. The December security release
  8. What it means for your site
  9. Sources

Next.js 16.5 was released on 2 December 2026. It makes production builds faster, lets some cached data survive a redeploy, and adds an experimental way to write API routes in Go. The timing matters too: the Next.js team has said its next scheduled security release, on 15 December, will be published on the 16.5.x line.

Faster builds that use less memory

The release focuses on Turbopack, the bundler Next.js uses for builds. The team says it now makes better use of every CPU core, scales to apps with thousands of routes, and uses less memory and disk space.

In the team's own benchmark of one large production app, cold compilation was about 4.2 times as fast as in 16.4.6, peak memory while compiling fell by 38%, and the on-disk cache was 14% smaller. A full production build from a cold cache took about half the time. These are the team's figures for its own apps; your results will depend on your project.

Turbopack's disk cache clean-up, added as an option in 16.4, is now on by default. The cache then grows with the size of your app rather than with the number of changes you make to it.

Cached data can survive a redeploy

Functions marked with 'use cache: remote' used to lose their cache on every deploy, because the deployment ID was part of each cache key. In 16.5, Turbopack builds the key from the function itself, the code it depends on and the environment values it reads.

If you redeploy after an unrelated change, a function whose code and dependencies have not changed can reuse the entries from the previous deployment. Entries still expire and revalidate as before, and Next.js stops reusing an entry when any of the function's imports or environment values change.

There is one catch. When Turbopack cannot work out everything a function depends on, it falls back to a key tied to the deployment, as before. The release notes give reading process.env dynamically, such as process.env[variable], as an example.

Bundle reports from your normal build

Running next build --analyze now writes a bundle report during the production build itself. Before, you ran a separate next analyze --output step, which compiled the app a second time. The new option also means the report matches exactly what you deploy.

Next.js 16.4 added the navigation() API, which keeps chosen content out of a prefetch until the visitor actually clicks. In 16.5, a single link can opt back in with <Link prefetch="navigation">. Once that link enters the viewport, Next.js prefetches all the cached content for the target page, including the deferred parts. It suits a "next" button or similar link the visitor is very likely to use.

Scheduled upgrades in CI

next upgrade --ci sets up a GitHub Actions workflow that checks for new releases every day. You choose whether it acts on security advisories only or on every stable release, and which hosted coding agent runs the upgrade. When a release matches, the agent upgrades the app and opens a pull request for you to review.

Two experimental features

  • Go Route Handlers. With experimental.goRoutes turned on and Go 1.24 or later installed, you can add a route.go file next to your TypeScript routes. Turbopack compiles it into a native executable served at that path. The team describes this as the first step towards native languages in Next.js, alongside a first phase of rewriting the next start server in Go.
  • Safe mode for image optimization. experimental.imgOptSafeMode switches next/image to an implementation that uses memory-safe image decoders, process isolation and sandboxing, to reduce the risk of processing untrusted images. The release notes say a hosting platform with its own image service may ignore this option in production.

The December security release

The Next.js team gave notice on 1 December that its scheduled security release on Tuesday, 15 December 2026 will fix eight high, one medium and one low severity vulnerabilities in Next.js. Full advisories will be published with the release. Because the fixes will be on the 16.5.x line, the team gave two weeks' notice instead of the usual one, so teams have time to test the minor upgrade first.

What it means for your site

  • If your site runs on Next.js 16.4 or earlier, plan to move to 16.5 before 15 December, so the security fixes are a patch update rather than a minor upgrade made under time pressure. Upgrade with npm install next@latest and run your tests.
  • If you use 'use cache: remote', check for dynamic process.env reads in cached functions; they keep the old per-deployment behaviour.
  • If you track bundle size in CI, swap the separate analyse step for next build --analyze.
  • Treat Go routes and image safe mode as experiments: try them on a branch, not on a live client site.
  • Mark 15 December in your calendar and read the advisories when they are published.

Sources

New posts by email

Product updates and field notes from Stacklumen, in one email a day or one a week.

How often