Headers function causing an empty page to be returned when using Optional Catch-all Segments #70252
Labels
bug
Issue was opened via the bug report template.
Partial Prerendering (PPR)
Related to Partial Prerendering.
Runtime
Related to Node.js or Edge Runtime with Next.js.
Link to the code that reproduces this issue
https://github.com/hugohammarstrom/next-ppr-headers-repro
To Reproduce
Current vs. Expected behavior
When using the headers() function in a page using Optional Catch-all Segments the root returns a completely empty page. In some cases the page flickers with the correct page before returning to an empty page again. This seems to only affect the root page.
This worked previously but as of a few days ago this error started happening.
Provide environment information
Node.js v20.17.0 Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 Available memory (MB): 65536 Available CPU cores: 10 Binaries: Node: 20.17.0 npm: 10.8.3 Yarn: 3.6.1 pnpm: N/A Relevant Packages: next: 15.0.0-canary.159 eslint-config-next: N/A react: 19.0.0-rc-5dcb0097-20240918 react-dom: 19.0.0-rc-5dcb0097-20240918 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Partial Prerendering (PPR), Runtime
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed)
Additional context
I've tried downgrading the canary version to a version that I know it worked on but I'm still seeing this error. My guess is that this is something in the vercel runtime.
I've seen a couple different error messages(in different canary versions) in the logs.
Error: invariant: cache entry required but not generated
Error: Invariant: postponed state should not be provided when fallback params are provided
Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.
The text was updated successfully, but these errors were encountered: