Dynamic component not re-rendered properly when it was the initial render with PPR enabled (only with npm build
)
#76263
Labels
Partial Prerendering (PPR)
Related to Partial Prerendering.
π Link to Minimal Reproduction
Codesandbox: Next.js PPR Dynamic Component Issue
Note: Ensure the
"prod"
task is active when testing.β Steps to Reproduce
"prod"
task is running, and open the preview./
route./
./about
as the initial route:/
, the PPR dynamic component renders correctly as expected.π Current vs. Expected Behavior
Current Behavior
/
, the PPR dynamic component does not re-render when navigating back and forth./about
) is used as the initial route, then the dynamic component behaves correctly.Expected Behavior
π Environment Information
15.2.0-canary.66
npm run dev
works fine)π― Affected Areas
β Partial Prerendering (PPR)
π§ Affected Stages
β
next build
(local production build)βΉοΈ Additional Context
npm run build && npm start
).npm run dev
), the issue does not occur.UPDATE (dirty fix):
When using the experimentalstaleTimes
feature I am able to "fix" the caching issue as explained above (https://nextjs.org/docs/app/api-reference/config/next-config-js/staleTimes).First, all the<Link>
usages should use eitherprefetch={true}
orprefetch={false}
, setting it tonull
does NOT work, then the caching bug still occurs!Adding this to mynext.config.ts
is a good temporary workaround for me:UPDATE 2:
Nevermind. When using
<Link>
with prefetch set to eithertrue
orfalse
disables the functionality of PPR in its entirety. So the above fix is not a real fix, it just makes it default to full page dynamic rendering.. πThe text was updated successfully, but these errors were encountered: