From 8d241ac4a742cc1a70b4a47f076e969558c3e2d8 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Wed, 8 Dec 2021 17:05:05 -0600 Subject: [PATCH] Document staticPageGenerationTimeout config (#32306) * Document staticPageGenerationTimeout config * Apply suggestions from code review Co-authored-by: Steven * Reword no activity * Apply suggestions from code review Co-authored-by: Steven * fix lint-language Co-authored-by: Steven --- docs/basic-features/data-fetching.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/basic-features/data-fetching.md b/docs/basic-features/data-fetching.md index 78a1162f0b10..198b05e1b358 100644 --- a/docs/basic-features/data-fetching.md +++ b/docs/basic-features/data-fetching.md @@ -45,6 +45,7 @@ In addition, we’ll talk briefly about how to fetch data on the client side. | Version | Changes | | --------- | ----------------------------------------------------------------------------------------------------------------- | +| `v12.0.0` | `staticPageGenerationTimeout` added. | | `v10.0.0` | `locale`, `locales`, `defaultLocale`, and `notFound` options added. | | `v9.5.0` | Stable [Incremental Static Regeneration](https://nextjs.org/blog/next-9-5#stable-incremental-static-regeneration) | | `v9.3.0` | `getStaticProps` introduced. | @@ -220,6 +221,17 @@ function Blog({ posts }: InferGetStaticPropsType) { export default Blog ``` +Note: Next.js has a default static generation timeout of 60 seconds. If no new pages complete generating within the timeout, it will attempt generation three more times. If the fourth attempt fails, the build will fail. This timeout can be modified using the following configuration: + +```js +// next.config.js +module.exports = { + // time in seconds of no pages generating during static + // generation before timing out + staticPageGenerationTimeout: 90, +} +``` + ### Incremental Static Regeneration