Open samselikoff opened 1 month ago
Seems to have been added in canary.155. In canary.154 it works as expected.
Hey @samselikoff, this looks to be caused by the React upgrade in canary.155, likely caused by https://github.com/facebook/react/pull/30935. I've notified the team and once it's fixed in React, we'll sync it into Next.js.
Link to the code that reproduces this issue
https://github.com/samselikoff/stale-link-updates-in-dev
To Reproduce
npm run dev
)Current vs. Expected behavior
Current:
The UI updates with all link navigations, including stale ones.
Expected:
The UI should discard stale link navigations, and only render the latest one once it settles.
Note: This behavior only happens on dev. When I deploy to Vercel, the UI only shows the final navigation.
Provide environment information
Which area(s) are affected? (Select all that apply)
Navigation
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
The
/post/[id]/page.tsx
is an RSC that awaits a 1-second Promise. The stale updates only happen in dev.Here's a video:
https://github.com/user-attachments/assets/cd5a2852-de0d-452c-a21e-2973f7337863
Here are some links to quickly see the two different behaviors:
❌ StackBlitz dev build: https://stackblitz.com/github/samselikoff/stale-link-updates-in-dev?file=app%2Flayout.tsx
✅ Vercel prod build: https://stale-link-updates-in-dev.vercel.app