-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encountered Static to Dynamic Error in Next.js production build #54
Comments
Hi, I'm using Contentful and it supports webhooks. So whenever I publish a blog post, it automatically triggers the deployment process, resulting in the rebuilding of all static pages. |
Thank you for your reply. I'm using Contentful for the first time today. May I ask for some advice regarding webhooks? Are you adding two webhooks - one to revalidate the I appreciate any guidance you can provide as I get started with leveraging Contentful webhooks appropriately. i see related const path = requestHeaders.get('path') ?? '/'
revalidatePath(path) |
I'm using just one webhook from Contentful and putting it in Vercel to rebuild the whole website to revalidate the cache. And the I'm closing this as it's not an issue. I've recently enabled the Discussions, so if you have any questions, feedback, or ideas, please feel free to reach out to me there. 🤞 |
Thanks for your reply. |
Hi, I am encountering the "Static to Dynamic Error" in production after deploying my Next.js project. This error occurs when I publish a new post in Contentful and then visit that post's page on my site.
I believe the issue is related to
generateStaticParams
function usage in the/writing/[slug]
route. Pages are statically generated at build time, but then fail when visiting a page that was not part of the initial build, so it will change into dynamic.My current workaround is adding
export const dynamic = 'force-dynamic'
in the page file, but this disables static generation entirely.I'm looking for advice on the best way to handle this since I'm new to Next.js. Should I redeploy the site every time I publish a new post in order to rebuild all static pages? Or is there a way to incrementally build only new pages? Appreciate any suggestions you may have!
The text was updated successfully, but these errors were encountered: