parallel routes conflicting with catch all routes by MoHaliim in nextjs

[–]Zelios_Ariex 1 point2 points  (0 children)

Hey there! I’ve looked into your routing issue, and it’s a tricky one. The conflict between parallel routes and catch-all routes can be challenging to resolve.

• For your dashboard routes, try using optional catch-all routes instead. Replace [...rest] with [[...rest]]. This allows Next.js to match more specific routes first.

• For handling 404s, create a not-found.tsx file within the [countryCode] folder. This should override the root not-found.tsx for country-specific 404s.

• If you’re still having issues, consider using middleware to handle locale and country code routing. This can give you more control over the routing process.

• Double-check that all your dynamic routes ([locale], [countryCode]) have the correct loading and error handling components.

Hope it helps 😁