[DynamicIO]PPR pages are rendered every time #77263
-
Link to the code that reproduces this issuehttps://github.com/AkifumiSato/nextjs-dynamicio-and-ppr-issue-demo To Reproduce
// app/page.tsx
export default async function Page() {
console.log("render: Page")
return (
<div>
...
<Suspense fallback={<>loading...</>}>
<Products />
</Suspense>
</div>
);
}
async function Products() {
console.log("render: Products Components")
// ...
} Build log
Request log
Current vs. Expected behaviorWhen a request comes in for a PPR page, we expect only the Dynamic Hole to be rendered. In reality, however, the entire page is rendered. This means that PPR will not work as intended when Next.js is employed for self-hosting. Provide environment informationOperating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:43 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6000
Available memory (MB): 32768
Available CPU cores: 8
Binaries:
Node: 20.10.0
npm: 10.2.3
Yarn: N/A
pnpm: 9.6.0
Relevant Packages:
next: 15.2.0-canary.60 // There is a newer canary version (15.2.0-canary.61) available, please upgrade!
eslint-config-next: N/A
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.3
Next.js Config:
output: N/A
⚠ There is a newer canary version (15.2.0-canary.61) available, please upgrade!
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue Which area(s) are affected? (Select all that apply)dynamicIO, Partial Prerendering (PPR) Which stage(s) are affected? (Select all that apply)next start (local) Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
I have a similar issue. My pages are prerendered although I do not use "use cache" there. IMO this should be the equivalent to "force-dynamic", because otherwise I have no way to disable prerendering for pages. |
Beta Was this translation helpful? Give feedback.
-
While I understand that opt-out is an important point, it would be reasonable to expect the pre-rendering results to be used when |
Beta Was this translation helpful? Give feedback.
-
@AkifumiSato This is working as expected for PPR page when there is a dynamic part. We need to re-run the static part of the render to generate the props and context needed to render the rest of the dynamic parts. The static parts should have all it's data cached (hence why it's static) so it should just be the render-dom code and not hitting the network (outside looking up cache entries). |
Beta Was this translation helpful? Give feedback.
@AkifumiSato This is working as expected for PPR page when there is a dynamic part.
We need to re-run the static part of the render to generate the props and context needed to render the rest of the dynamic parts. The static parts should have all it's data cached (hence why it's static) so it should just be the render-dom code and not hitting the network (outside looking up cache entries).