Skip to content

[Next 14] Partial Pre-Rendering (ppr) causes duplicate fetch calls on page revalidation #58084

Closed as not planned
@better-salmon

Description

@better-salmon

Link to the code that reproduces this issue

https://github.com/better-salmon/next14-ppr-double-revalidation-bug

To Reproduce

  1. Run backend server with npm run backend.
  2. In the separate terminal build and start the app with npm run build && npm run start.
  3. Open http://localhost:3000/count in the browser.
  4. Wait for the Cache state field to change to stale.
  5. Reload the page twice to see the revalidated page with Cache state: fresh.
  6. Optionally, open the terminal with the backend and see that in logs /count route was triggered twice.

Current vs. Expected behavior

Expected behavior:

When ppr option is enabled or disabled, the value should be greater than before by 1 after each revalidation.

Actual behavior:

When ppr option is enabled, the value is greater than before by 2 after each revalidation, meaning that the fetch was triggered twice.

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.1.0: Mon Oct  9 21:28:31 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8112
Binaries:
  Node: 20.9.0
  npm: 10.1.0
  Yarn: N/A
  pnpm: 8.10.0
Relevant Packages:
  next: 14.0.2-canary.13
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

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

App Router

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugIssue was opened via the bug report template.staleThe issue has not seen recent activity.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions