Next.js Discord

Discord Forum

generateDynamicParams invalidates dynamicParams = false when empty

Thai posted this in #help-forum
Open in Discord
We have an optional catch-all route where we use generateStaticParams. We have dynamicParams = false at the top of the page to 404 any pages which aren't returned in generateStaticParams.

If an empty array is returned from generateStaticParams, it seems to invalidate the dynamicParams = false, and begins returning all routes with an empty page, rather than 404ing those pages.

I tested this with the latest version of Next and have an example repo here:

Does anyone know what the functionality should be if an empty array is returned from generateStaticParams?

0 Replies