To see the intercepted route trigger:
From index page:
Click on users link
Click user 1 link → modal is shown
Click index
Click on shortcut user 1 → users page + modal is shown
In reverse, intercepted route not triggered when a previous navigation was done outside of /users route:
From index page:
Click on shortcut user 2 → user's full page is shown
click on users
click on user 2 → user's full page is shown
Current vs. Expected behavior
In the current behavior, Nextjs is using the client cache of a previous navigation even outside of the defined subpath for the intercepted route.
I was expecting that Nextjs will open full-page outside /users page and always intercept a route inside /users page, even when a previous navigation is known by the router on the client cache for that specific route.
Verify canary release
[X] I verified that the issue exists in the latest Next.js canary release
Link to the code that reproduces this issue
To Reproduce
To see the intercepted route trigger: From index page:
users
linkuser 1
link → modal is shownindex
shortcut user 1
→ users page + modal is shownIn reverse, intercepted route not triggered when a previous navigation was done outside of
/users
route: From index page:shortcut user 2
→ user's full page is shownusers
user 2
→ user's full page is shownCurrent vs. Expected behavior
In the current behavior, Nextjs is using the client cache of a previous navigation even outside of the defined subpath for the intercepted route.
I was expecting that Nextjs will open full-page outside
/users
page and always intercept a route inside/users
page, even when a previous navigation is known by the router on the client cache for that specific route.Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router
Additional context
No response