Dynamic routes with SSR lead to 404 pages on visit #10990
-
Bug reportDescribe the bugI have a nextjs application, which supports pretty url like: https://demo.oga.fit/balance or https://demo.oga.fit/balance/diva-yoga. It is exported to work behind gitlab pages. The slugs are loaded from the backend over a request. The home page lists them. When going from the home page to the slug based URL, the pages are working. However, if I refresh the browser when already on the above mentioned URL, it shows a 404 page instead. To ReproduceSteps to reproduce the behavior, please provide code snippets or a repository:
Expected behaviorInstead of the 404 page, I'd assume that the dynamic routes would come into play and render the actual content. Additional contextIt is a closed source application; I'd not be able to share code snippets. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
This makes it impossible to look into this. But my initial thoughts are that you're not providing all paths to be exported. You will probably want to adopt https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation |
Beta Was this translation helpful? Give feedback.
-
@timneutkens The paths are not constant. They might vary between backend deployments. |
Beta Was this translation helpful? Give feedback.
-
Moved the project to zeit now deployment. Thanks for the pointers. |
Beta Was this translation helpful? Give feedback.
Moved the project to zeit now deployment. Thanks for the pointers.