Router.push takes to incorrect page but refreshing same exact URL opens correct page. #45000
Open
1 task done
Labels
examples
Issue/PR related to examples
Verify canary release
Provide environment information
Which example does this report relate to?
catch-all-routes
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
For some reason, my dynamic route is rendered instead of catch all route when I use router.push or Link component. But when I refresh the page, the exact same url renders correct catch all route page. Folder layout attached below.
getStaticPath Reference
pages/[category-slug]/[...category-concern-filter-slug]/index.jsx
pages/[category-slug]/[collection-slug]/[product-slug]/index.jsx
Expected Behavior
When I go to this url /hair/shop-by-hair-type-&-concern/dry-scalp-&-dandruff. Page stating 'concernssss' renders which is correct. That file is located at
pages/[category-slug]/[...category-concern-filter-slug]/index.jsx
When I try to do Router.push('/hair/shop-by-hair-type-&-concern/dry-scalp-&-dandruff'), it takes me to the error page which is trying to render file located at
pages/[category-slug]/[collection-slug]/[product-slug]/index.jsx
To Reproduce
Have catch all route in same directory as dynamic route and try Router.push.
The text was updated successfully, but these errors were encountered: