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

Stale link navigations are updating the UI in local dev #70977

Open
samselikoff opened this issue Oct 8, 2024 · 2 comments
Open

Stale link navigations are updating the UI in local dev #70977

samselikoff opened this issue Oct 8, 2024 · 2 comments
Labels
bug Issue was opened via the bug report template. Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation.

Comments

@samselikoff
Copy link

samselikoff commented Oct 8, 2024

Link to the code that reproduces this issue

https://github.com/samselikoff/stale-link-updates-in-dev

To Reproduce

  1. Start the application in development (npm run dev)
  2. Quickly click Link 1, Link 2, then Link 3
  3. You'll see the UI update with all three navigations – it will show "Post 1", "Post 2" and "Post3"

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

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
  Available memory (MB): 65536
  Available CPU cores: 10
Binaries:
  Node: 20.9.0
  npm: 10.1.0
  Yarn: N/A
  pnpm: 9.7.1
Relevant Packages:
  next: 15.0.0-canary.179 // Latest available version is detected (15.0.0-canary.179).
  eslint-config-next: N/A
  react: 19.0.0-rc-2d16326d-20240930
  react-dom: 19.0.0-rc-2d16326d-20240930
  typescript: 5.3.3
Next.js Config:
  output: N/A

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:

Screen.Recording.2024-10-08.at.3.34.56.PM.mov

Here are some links to quickly see the two different behaviors:

@samselikoff samselikoff added the bug Issue was opened via the bug report template. label Oct 8, 2024
@github-actions github-actions bot added the Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. label Oct 8, 2024
@samselikoff
Copy link
Author

Seems to have been added in canary.155. In canary.154 it works as expected.

@ztanner
Copy link
Member

ztanner commented Oct 14, 2024

Hey @samselikoff, this looks to be caused by the React upgrade in canary.155, likely caused by facebook/react#30935. I've notified the team and once it's fixed in React, we'll sync it into Next.js.

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. Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests

2 participants