Query parameters incorrect when navigating from App Router to Pages Router #72884
Labels
bug
Issue was opened via the bug report template.
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Pages Router
Related to Pages Router.
Link to the code that reproduces this issue
https://github.com/ledbetterljoshua/link-bug-reproduction
To Reproduce
Live Demo
https://link-bug-reproduction.vercel.app/
Repository
https://github.com/ledbetterljoshua/link-bug-reproduction
Steps to reproduce
link=1
)Current vs. Expected behavior
Current behavior
Each Link component should navigate to the Pages Router page with its specified query parameter intact:
/pages-route?link=1
/pages-route?link=2
/pages-route?link=3
Actual behavior
/pages-route?link=1
)/pages-route?link=1
, ignoring their specified query parametersProvide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.0.0: Thu Jun 20 20:38:33 PDT 2024; root:xnu-11215.0.115.501.3~1/RELEASE_ARM64_T8112 Available memory (MB): 24576 Available CPU cores: 8 Binaries: Node: 20.10.0 npm: 10.2.3 Yarn: 1.22.17 pnpm: N/A Relevant Packages: next: 15.0.3 // Latest available version is detected (15.0.3). eslint-config-next: 15.0.3 react: 19.0.0-rc-66855b96-20241106 react-dom: 19.0.0-rc-66855b96-20241106 typescript: 5.6.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Navigation, Pages Router
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed)
Additional context
Description
When navigating from a page in the App Router to a page in the Pages Router using Next.js Link components, query parameters are not being properly maintained. The first query parameter encountered becomes "sticky" and is used for all subsequent navigations to the Pages Router page, regardless of the actual query parameters specified in the Links and in the DOM.
Additional observations
Environment
Notes
This appears to be a client-side navigation issue, as:
Would appreciate guidance on whether this is a known issue or if there's a recommended workaround while we gradually migrate from Pages Router to App Router.
The text was updated successfully, but these errors were encountered: