Skip to content

The router state header was sent but could not be parsed error occurs during version skew (v15 => v16.2) #92961

@mizdra

Description

@mizdra

Link to the code that reproduces this issue

https://github.com/mizdra-sandbox/repro-next-version-skew-prefetch-bug

To Reproduce

  1. Start the old version of Next.js: cd next-old && pnpm run build && pnpm run start &
  2. Open http://localhost:3000/ in the browser.
  3. Stop the old version of Next.js: killall -9 "next-server (v15.5.15)"
  4. Start the new version of Next.js: cd next-new && pnpm run build && pnpm run start &
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    HeadersRelated to the async headers() function.Not FoundRelated to the not-found.tsx file or the notFound() function.RuntimeRelated to Node.js or Edge Runtime with Next.js.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions