2023-07-05 15:11:16 +02:00
|
|
|
---
|
|
|
|
title: Static page generation timed out after multiple attempts
|
|
|
|
---
|
2021-07-16 11:21:44 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Why This Error Occurred
|
2021-07-16 11:21:44 +02:00
|
|
|
|
|
|
|
Next.js tries to restart the worker pool of the static page generation when no progress happens for a while, to avoid hanging builds.
|
|
|
|
|
|
|
|
When restarted it will retry all uncompleted jobs, but if a job was unsuccessfully attempted multiple times, this will lead to an error.
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Possible Ways to Fix It
|
2021-07-16 11:21:44 +02:00
|
|
|
|
|
|
|
- Make sure that there is no infinite loop during execution.
|
2021-08-12 21:54:49 +02:00
|
|
|
- Make sure all Promises in `getStaticPaths`/`getStaticProps` `resolve` or `reject` correctly.
|
2021-07-16 11:21:44 +02:00
|
|
|
- Avoid very long timeouts for network requests.
|
2021-10-20 21:06:43 +02:00
|
|
|
- Increase the timeout by changing the `staticPageGenerationTimeout` configuration option (default `60` in seconds).
|
2021-07-16 11:21:44 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Useful Links
|
2021-07-16 11:21:44 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
- [`getStaticPaths`](/docs/pages/building-your-application/data-fetching/get-static-paths)
|
|
|
|
- [`getStaticProps`](/docs/pages/building-your-application/data-fetching/get-static-props)
|