router.replace()
on pages with query params cause entire page re-render on Next 14.2.3
#66427
Labels
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/delicate-shadow-nwztm4
To Reproduce
Using the code sanbox provided above:
Current vs. Expected behavior
Expected Behavior
When updating the pagination query parameter (p), the page (with url slug) content should dynamically update without triggering a full page reload, as it correctly does on the main page (/).
Actual Behavior
The entire page reloads on routes other than the main page (without url slug) whenever the pagination query parameter (p) is updated, resetting the scroll position to the top.
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Thu Jan 11 04:09:03 UTC 2024 Available memory (MB): 32102 Available CPU cores: 12 Binaries: Node: 18.20.3 npm: 10.7.0 Yarn: N/A pnpm: 8.6.7 Relevant Packages: next: 14.2.3 // Latest available version is detected (14.2.3). eslint-config-next: 13.5.3 react: 18.2.0 react-dom: 18.2.0 typescript: 5.2.2 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), next build (local), Vercel (Deployed)
Additional context
This happens when upgrading many dependencies, the error is gone when using window.location.replace(), but it leaves my navigation stack in a funky state, meaning that i have to go back for every page that is changed in the url.
Experimental scroll restoration is enabled (disabled gives me the same results)
The text was updated successfully, but these errors were encountered: