Skip to content

next-router-prefetch header missing on some prefetch requests #85836

@salazarm

Description

@salazarm

Link to the code that reproduces this issue

https://github.com/salazarm/nextjs-missing-prefetch-header/tree/main/nextjs-missing-prefetch-header

To Reproduce

  1. Build the repo app npm run dev and start it npm run start.

  2. Observe in the network panel that we're prefetching the same url twice, once with the next-router-prefetch header set and once without.

    From the guide here:
    I'm using:

 missing: [
        { type: 'header', key: 'next-router-prefetch' },
        { type: 'header', key: 'purpose', value: 'prefetch' },
      ],

But since sometimes the prefetch doesn't include next-router-prefetch we end up including the CSP on those and in my case the CSP is 7kb and we make a lot of prefetch requests so it adds up quickly.

Current vs. Expected behavior

  1. I expected all prefetch requests to include the next-router-prefetch header
  2. I expect to only prefetch the 123 route once.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:26 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 14
Binaries:
  Node: 22.19.0
  npm: 10.9.3
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure, Dynamic Routes

Which stage(s) are affected? (Select all that apply)

next build (local), Vercel (Deployed)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions