-
Notifications
You must be signed in to change notification settings - Fork 28.4k
Next.js 15 <Link>
scroll to top does not work if loading.tsx
is present
#74485
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
Comments
<Link>
scroll to top does not work if Loading.tsx
is present<Link>
scroll to top does not work if loading.tsx
is present
Having the same issue with Nextjs 15. Just replaced my loading files by Suspense's inside my layouts/pages as workaround. |
Having the same issue after migrate from 14 to 15.1.6 version |
No word on this? It's a pretty big bug... |
I have this issue as well. I cannot use the workaround, eg. using Suspense in my app/page.tsx, because it does not work in combination with ISR (works in dev, not in production). Is this a known bug? loading.tsx does work in combination with ISR, so I'd love for this to be solved. I don't want to scroll to top manually for every link. |
Big issue that needs to be fixed! We also experience it, only by deleting/renaming the loading file scrolling to top on navigation(pagination) works. Sad that a feature is this broken.. |
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: