Next.js 15 <Link>
scroll to top does not work if loading.tsx
is present
#74485
Labels
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/youthful-davinci-xs9gmf
To Reproduce
npm run build && npm run start
).Current vs. Expected behavior
The page should scroll to the top when pressing the "Next" and "Previous" buttons on the "withloading" page, but it does not.
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Available memory (MB): 8198 Available CPU cores: 4 Binaries: Node: 20.9.0 npm: 9.8.1 Yarn: 1.22.19 pnpm: 8.10.2 Relevant Packages: next: 15.1.1-canary.24 // Latest available version is detected (15.1.1-canary.24). eslint-config-next: N/A react: 19.0.0-beta-04b058868c-20240508 react-dom: 19.0.0-beta-04b058868c-20240508 typescript: 5.1.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 start (local)
Additional context
This bug only occurs with
next start
and not withnext dev
. It is also present only in Next.js 15 and works fine in Next.js 14. As far as I know, it doesn't matter what is returned byloading.tsx
, as returning anything at all will result in this bug.The text was updated successfully, but these errors were encountered: