Skip to content

Next 16.0.0/16.0.1-canary.2: next/link Prefetch Causes 404 for RSC Payloads in Static Export #85374

@Aaakul

Description

@Aaakul

Link to the code that reproduces this issue

https://github.com/Aaakul/next16-next-link-rsc-issue

To Reproduce

  1. Clone the reproduction repository
  2. Run cd next16
  3. Run npm install
  4. Run npm run build (output: 'export' is already set in next.config.ts)
  5. Run npx serve out
  6. Visit /next16 in a browser (e.g., http://localhost:3000/next16), open developer tools and check the console for 404 errors. Click the link to navigate to /next16/page, refresh and check if similar errors appears.
  7. Run cd ..
  8. Run cd next15
  9. Repeat 3~6

Current vs. Expected behavior

Current Behavior (Next.js 16.0.0/16.0.1-canary.2 + output: 'export'):

When visiting static exported page has next/link with default prefetching or is explicitly set to true / "auto" / null, the page attempts to fetch the target page's RSC Payload from incorrect path, resulting in a 404 Not Found error (e.g., '.../page/__next.page.PAGE.txt?_rsc=...').
Image

Expected Behavior (Next.js 15.5.6 + output: 'export'):

Invalid RSC requests are not expected in statically exported pages

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Home
  Available memory (MB): 32578
  Available CPU cores: 16
Binaries:
  Node: 20.19.5
  npm: 10.8.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.0.1-canary.2
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: export

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

Linking and Navigating, Output

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

next build (local), Other (Deployed)

Additional context

  • Reproducible Versions: Next.js 16.0.0 and 16.0.1-canary.2.
  • This issue does not exist in Next.js 15.5.6
  • This issue is reproducible locally using npx serve out and is also observed on static hosting platforms like GitHub Pages: https://aaakul.github.io/next16/ and Cloudflare Pages

Comparing my demo's output .txt files:

  • Next 15.5.6: index.txt page.txt
  • Next 16.0.1-canary.2:
│  index.txt
│  page.txt
│  _not-found.txt
│  __next._full.txt
│  __next._index.txt
│  __next._tree.txt
│  __next.__PAGE__.txt
│
|─page
│  │  __next.page.txt
│  │  __next._full.txt
│  │  __next._index.txt
│  │  __next._tree.txt
│  │
│  └─__next.page
│          __PAGE__.txt
│
└─_not-found
    │  __next._full.txt
    │  __next._index.txt
    │  __next._not-found.txt
    │  __next._tree.txt
    └─__next._not-found
            __PAGE__.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.OutputRelated to the the output configuration option.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions