Skip to content

Link prefetch in static export does not work when Link component has prefetch={true} #92341

@na-trium-144

Description

@na-trium-144

Link to the code that reproduces this issue

https://github.com/mdj-uk/static-export-prefetch-bug

To Reproduce

Current vs. Expected behavior

Current behavior:

  • When the page loads, it makes a GET request to http://localhost:3000/page1?_rsc=... which returns HTML instead of RSC payload.
  • Clicking the link to page1 in this state results in no action, and no error messages are displayed in the console.
Image

Expected behavior:

  • Prefetch works and the Link function correctly as if the prefetch prop were not set or was set to "auto".
  • When prefetch="auto", it seems the correct behavior is that GET requests to __next._tree.txt, __next._head.txt, __next._index.txt, __next.page1.txt, __next.page1.__PAGE__.txt are made.
Image
  • Alternatively, fetch /page1.txt which is also a RSC payload?

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.3.0: Wed Jan 28 20:53:01 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T8103
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 22.16.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.28.1
Relevant Packages:
  next: 16.2.2 // Latest available version is detected (16.2.2).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: export

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

Output

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

next build (local)

Additional context

  • Next.js 16.1.0 and later versions, including latest stable 16.2.2 and latest canary, has the behavior described in the issue.
  • Next.js 16.0.0 - 16.0.11 also fail to prefetch, fetching the HTML for /page1 during page load. However, clicking a link causes /page1.txt to be fetched again, and the link at least works.
  • In Next.js 15, it prefetches /page1.txt when page loads and the link works.

This issue was originally posted as #92213

Metadata

Metadata

Assignees

No one assigned

    Labels

    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