Next.js Discord

Discord Forum

Help me understand generateStaticParams

Unanswered
Himalayan posted this in #help-forum
Open in Discord
HimalayanOP
If I generate pages at build time using a CMS response and use dynamicParams = false, is it then impossible to publish a new page in the CMS and have it render at request time?

Revalidation is working when updating content for pages that are already built. But if the page wasn’t generated with generateStaticParams then it won’t generate a new page. I assume I need to allow dynamicParams which of course means any page can be accessed. Do I then just check for data in the page and if nothing is returned just manually call notFound()?

That way I guess generateStaticParams generates pages at build time. Subsequent visits to new published pages then generate at request time. So those request time pages get cached until the next build?

I do have on demand revalidation set up but although the request is received correctly it doesn’t do anything to generate a page. Again, I guess because of dynamicParams being false. Or am I misunderstanding something and this should all be working even with it false and I’ve done something wrong .

0 Replies