Page reloads when navigating between pages with Link
if /pages
and /app
coexist
#53067
Open
1 task done
Labels
bug
Issue was opened via the bug report template.
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023 Binaries: Node: 18.16.0 npm: 9.5.1 Yarn: 1.22.19 pnpm: 8.4.0 Relevant Packages: next: 13.4.12-canary.0 eslint-config-next: 13.4.12 react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.6 Next.js Config: output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router, Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/pages-app-coexist-gnyqqc
To Reproduce
The sandbox was started from the Next.js template. I have added the components as shown in the following directory tree:
All
index.js
files are identical, displaying the currentcategoryId
. Thenav.js
renders the links to navigate between pages.First case:
Second case:
Following is the recording for the first case:
1.mp4
Describe the Bug
The page in
/pages
reloads when navigating between pages withLink
fromnext/link
if both/app
and/pages
coexist. The unwanted behavior does not occur for most variants of preceding URL segments. An example is/explore
. I found some positive examples, such as/csb
and/explore123
, where one out of six of the pages reloads in both cases. Interestingly, changing the preceding segment changes the page that causes the reload.Expected Behavior
The page must not reload when clicking between links.
The recording below shows the working example when the preceding segment is
/explore
2.mp4
Which browser are you using? (if relevant)
Chrome 115.0.5790.99
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: