Link to the code that reproduces this issue
https://github.com/mizdra-sandbox/repro-next-version-skew-prefetch-bug
To Reproduce
- Start the old version of Next.js:
cd next-old && pnpm run build && pnpm run start &
- Open http://localhost:3000/ in the browser.
- Stop the old version of Next.js:
killall -9 "next-server (v15.5.15)"
- Start the new version of Next.js:
cd next-new && pnpm run build && pnpm run start &
- Scroll down in the browser until you can see the link to Sub Page
Current vs. Expected behavior
Actual behavior
The new version of Next.js server outputs the following error:
Expected behavior
The new version of Next.js server outputs no errors.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.4.0: Thu Mar 19 19:33:25 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T6041
Available memory (MB): 49152
Available CPU cores: 14
Binaries:
Node: 24.15.0
npm: 11.12.1
Yarn: 1.22.22
pnpm: 10.33.0
Relevant Packages:
next: 16.2.4 // Latest available version is detected (16.2.4).
eslint-config-next: N/A
react: 19.2.5
react-dom: 19.2.5
typescript: 5.9.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Runtime, Headers, Not Found
Which stage(s) are affected? (Select all that apply)
next start (local), Other (Deployed)
Additional context
- The error occurs when a prefetch request is sent from a page rendered by an older version of Next.js to a newer version of Next.js server.
- The following conditions are required to reproduce:
- The older version of Next.js must be version 15 (reproduced confirmed in 15.0.0 and 15.5.15, though not all versions have been tested)
- The newer version of Next.js must be version 16.2 (reproduced in 16.2.0 and 16.2.4, but not in 16.1.7)
- Dynamic API (e.g.,
headers(), cookies()) is called within not-found.tsx
- The server is running in the background
- The prefetch request returns 500.
- On pages with many embedded links, a large number of prefetch requests are sent. As a result, many errors occur.
- Errors only occur on the server side, with no particular impact to the user. When the user clicks the link to Sub Page, the browser navigates to Sub Page.
- I've also confirmed the same error in Next.js running on Google Cloud Run.
- I'm sorry, but I don't have a minimal reproduction code.
- Searching X, it appears that several users have encountered this error.
Link to the code that reproduces this issue
https://github.com/mizdra-sandbox/repro-next-version-skew-prefetch-bug
To Reproduce
cd next-old && pnpm run build && pnpm run start &killall -9 "next-server (v15.5.15)"cd next-new && pnpm run build && pnpm run start &Current vs. Expected behavior
Actual behavior
The new version of Next.js server outputs the following error:
Expected behavior
The new version of Next.js server outputs no errors.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 25.4.0: Thu Mar 19 19:33:25 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T6041 Available memory (MB): 49152 Available CPU cores: 14 Binaries: Node: 24.15.0 npm: 11.12.1 Yarn: 1.22.22 pnpm: 10.33.0 Relevant Packages: next: 16.2.4 // Latest available version is detected (16.2.4). eslint-config-next: N/A react: 19.2.5 react-dom: 19.2.5 typescript: 5.9.3 Next.js Config: output: N/AWhich area(s) are affected? (Select all that apply)
Runtime, Headers, Not Found
Which stage(s) are affected? (Select all that apply)
next start (local), Other (Deployed)
Additional context
headers(),cookies()) is called withinnot-found.tsx