Skip to content
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

Bug in Link causing server navigation when app directory + pages present #54231

Open
1 task done
myxoh opened this issue Aug 18, 2023 · 5 comments
Open
1 task done

Bug in Link causing server navigation when app directory + pages present #54231

myxoh opened this issue Aug 18, 2023 · 5 comments
Labels
bug Issue was opened via the bug report template.

Comments

@myxoh
Copy link

myxoh commented Aug 18, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Tested on Macbook and Windows, on chrome, safari and edge.

Produced a minimum viable example and tested on next 13.2 to canary (13.18+)

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://github.com/superwave-team/next-bug

To Reproduce

  • run npm dev or pnpm dev
  • Go to http://localhost:3000/channel/test-2
  • Navigate to any of the "not reload" links (You see the same ID and no new page load)
  • Go to the "reload" link (You see a new ID and the page loading from 0) (On the network tab you see that we are doing a page navigation and loading a new document)

Describe the Bug

When the app directory and pages app are present, there seems to be some cases where paths that shouldn't overlap are causing conflicts. In our case we detected this (in a minimally reproduceable example) on /channel/test-2 (Pages) and /community/new (App)

When a user tries to load the page in pages, the component is triggering a full page navigation as opposed to correctly detecting the page should load client side.

CleanShot.2023-08-18.at.15.54.18.1.mp4

Expected Behavior

All these links should be client side navigations. There should be no conflicts.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@myxoh myxoh added the bug Issue was opened via the bug report template. label Aug 18, 2023
@yjoer
Copy link
Contributor

yjoer commented Aug 19, 2023

I reported a similar one last month. Linking it here for visibility #53067

@myxoh
Copy link
Author

myxoh commented Aug 19, 2023

You are right @yjoer I searched and somehow missed this one. Should I close mine ?
I'm not sure which one to leave given neither of them have any traction yet 😞

@yjoer
Copy link
Contributor

yjoer commented Aug 19, 2023

I guess we can leave both open. In my case, the paths causing the problem in my local environment and CodeSandbox were different. It might be possible for this to go away in certain paths and appears in some other paths. 😵

@myxoh
Copy link
Author

myxoh commented Aug 21, 2023

OK after some digging in Next.JS project I've managed to spot the differnece.
This link seems to trigger: matchesBflStatic true
in packages/next/src/shared/lib/router/router.ts line 1109 - causing the page to go to handleHardNavigation.

I'll debug more to understand what this check is and why it's triggered on this path

@myxoh
Copy link
Author

myxoh commented Aug 21, 2023

Ok seems this is down to Bloom Filter collisions - at this stage this starts going a bit over my head by @ijjk maybe you have some insights?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

2 participants