Next.js: dynamic subpage works in dev, but production returns 404
Locally, the guide or implementation opens, but after publication the selected service returns 404.
Where's the problem coming from?
With static generation, some of the addresses may not have gone to genericStaticParams, while dynamicParams=false blocks unknown paths.
What to do step by step?
1. Determine whether the route uses generationStaticParams and dynamicParams=false.
2 . Compare the desired service with the list returned during the production build.
3 . Check case normalization, Polish characters and final slashes.
4 . Make sure the guide data is available during compilation, not only in the browser.
5 . Start build and local production start, then visit some random service.
Correction test and important trap
Each address from the list of contents and sitemap returns 200 after the production build.
Do not set the dynamicParams=true without thinking about generating and handling wrong addresses.