Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers function causing an empty page to be returned when using Optional Catch-all Segments #70252

Open
hugohammarstrom opened this issue Sep 19, 2024 · 0 comments
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.

Comments

@hugohammarstrom
Copy link

Link to the code that reproduces this issue

https://github.com/hugohammarstrom/next-ppr-headers-repro

To Reproduce

  1. Deploy repo to vercel
  2. Go to root path
  3. Go to any other path and see that the page works as expected

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.

@hugohammarstrom hugohammarstrom added the bug Issue was opened via the bug report template. label Sep 19, 2024
@github-actions github-actions bot added Partial Prerendering (PPR) Related to Partial Prerendering. Runtime Related to Node.js or Edge Runtime with Next.js. labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant