Open Gritteh opened 1 week ago
So this might help
on the application (that I can't share), when going to the /us path, in the catch-all page (wrong page), the slug comes through as slug: [ '_next', 'static', 'css', 'app', 'index.esm.css.map' ]
. But when on the correct catch-all page, let's say /us/garden
, slug is slug: [ 'garden' ]
Something definitely wrong with nextjs here!
when routing to /uk, console is trying to route to 2 things (incorrect - triggering catch-all as well as dynamic):
GET /uk 200 in 952ms
GET /_next/static/css/app/index.esm.css.map 307 in 403ms
GET /uk/_next/static/css/app/index.esm.css.map 200 in 232ms
only 1 GET for /uk/garden
(correct catch-all trigger)
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/suspicious-pine-go8s7s?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522cm20a6r6w00063b6wzyhxsa0n%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522cm20a6r6v00023b6wqv6kbi1q%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522cm20a6r6v00043b6wab58upw0%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522cm20a6r6w00053b6wmeeae01k%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522cm20a6r6v00023b6wqv6kbi1q%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522cm20a6r6v00013b6w1hndt8h0%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252FREADME.md%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%252C%2522id%2522%253A%2522cm20a6r6v00023b6wqv6kbi1q%2522%252C%2522activeTabId%2522%253A%2522cm20a6r6v00013b6w1hndt8h0%2522%257D%252C%2522cm20a6r6w00053b6wmeeae01k%2522%253A%257B%2522id%2522%253A%2522cm20a6r6w00053b6wmeeae01k%2522%252C%2522activeTabId%2522%253A%2522cm20a84p6008x3b6w9sbw3g1u%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A3000%252C%2522id%2522%253A%2522cm20a84p6008x3b6w9sbw3g1u%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252Fus%2522%257D%255D%257D%252C%2522cm20a6r6v00043b6wab58upw0%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522cm20a6r6v00033b6wuq4qm7xh%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%255D%252C%2522id%2522%253A%2522cm20a6r6v00043b6wab58upw0%2522%252C%2522activeTabId%2522%253A%2522cm20a6r6v00033b6wuq4qm7xh%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D
To Reproduce
app/[dynamic]/[...catchAll]/
)It seems to work in sandbox but not locally... Please can this be checked out
Current vs. Expected behavior
app/[dynamic]/[...catchAll]/
When navigating to path
/us
, for example,/app/[dynamic]/page.tsx
should be the relevant page triggered, and yes it is the one that gets used, but the console logs inside/app/[dynamic]/[...catchAll]/page.tsx
are being triggered also. This is not the expected behaviour according to docs:https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#catch-all-segments
see the 'optional catch-all' bit - literally the only difference is to do what I stated above, if it's desired. Therefore the (non-optional) 'catch-all' should not be triggering the
/us
path as mentioned above.Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure, Developer Experience, Documentation, Module Resolution, Navigation, Parallel & Intercepting Routes, Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Other (Deployed)
Additional context
No response