vercel / next.js

The React Framework
https://nextjs.org
MIT License
126.69k stars 26.93k forks source link

Old Content Persists After Navigation in Next.js on Chrome #71670

Open johackim opened 1 week ago

johackim commented 1 week ago

Link to the code that reproduces this issue

https://github.com/johackim/my-minimal-nextjs-issue-reproduction/

To Reproduce

  1. git clone https://github.com/johackim/my-minimal-nextjs-issue-reproduction/
  2. yarn
  3. npm run dev
  4. Go to http://localhost:3000
  5. Click on the "Go to test page" link at the bottom of the homepage
  6. Scroll down

Current vs. Expected behavior

Old page content remains visible below new page after navigation in next.js on Chrome/Chromium :

https://github.com/user-attachments/assets/971bba77-c449-42e0-b701-aa0fed70e291

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Thu, 10 Oct 2024 20:11:06 +0000
  Available memory (MB): 7943
  Available CPU cores: 4
Binaries:
  Node: 20.13.1
  npm: 10.5.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.0.0 // Latest available version is detected (15.0.0).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: N/A
Next.js Config:
  output: N/A

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

Not sure

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

next dev (local), next build (local), next start (local)

Additional context

No response

ztanner commented 1 week ago

Hi, I'm unable to reproduce this on Chrome version 130.0.6723.59. Can you share a bit more information about what version of Chrome you're using? Could you also ensure that you don't have any extensions enabled or experimental Chrome features?

johackim commented 1 week ago

Hello @ztanner, thanks for your answer.

My version of chrome is 130.0.6723.58.

I have nothing but a fresh setup of Chrome:

google-chrome-stable --user-data-dir=/tmp/chrome

Actually, it seems to work with the new version 130.0.6723.69. Maybe a Chrome bug.

HelloImGabriel commented 1 week ago

I have this same issue in Chrome and with Edge too, seems to happen only when I use the Link component, I'm on the bottom of the page, and the page is considerably longer than the page I'm navigating to... the bug behaviour it's pretty consistent even in a fresh Next app

Edit: After update Chrome to 130.0.6723.70 seems to work fine, bug is persistent in Edge 130.0.2849.52 thought