-
Notifications
You must be signed in to change notification settings - Fork 30.8k
Link prefetch in static export does not work when Link component has prefetch={true} #92341
Copy link
Copy link
Open
Open
Copy link
Labels
OutputRelated to the the output configuration option.Related to the the output configuration option.
Description
Link to the code that reproduces this issue
https://github.com/mdj-uk/static-export-prefetch-bug
To Reproduce
pnpm install,pnpm buildpnpm dlx serve out- open http://localhost:3000/
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.
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__.txtare made.
- Alternatively, fetch
/page1.txtwhich 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: exportWhich 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
/page1during page load. However, clicking a link causes/page1.txtto be fetched again, and the link at least works. - In Next.js 15, it prefetches
/page1.txtwhen page loads and the link works.
This issue was originally posted as #92213
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
OutputRelated to the the output configuration option.Related to the the output configuration option.