Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion errors/static-page-generation-timeout.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ When restarted it will retry all uncompleted jobs, but if a job was unsuccessful
- Make sure that there is no infinite loop during execution.
- Make sure all Promises in `getStaticPaths`/`getStaticProps` `resolve` or `reject` correctly.
- Avoid very long timeouts for network requests.
- Increase the timeout by changing the `experimental.staticPageGenerationTimeout` configuration option (default `60` in seconds).
- Increase the timeout by changing the `staticPageGenerationTimeout` configuration option (default `60` in seconds).

### Useful Links

Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ export default async function build(
await promises.readFile(buildManifestPath, 'utf8')
) as BuildManifest

const timeout = config.experimental.staticPageGenerationTimeout || 0
const timeout = config.staticPageGenerationTimeout || 0
const sharedPool = config.experimental.sharedPool || false
const staticWorker = sharedPool
? require.resolve('./worker')
Expand Down
2 changes: 1 addition & 1 deletion packages/next/export/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ export default async function exportApp(
)
}

const timeout = configuration?.experimental.staticPageGenerationTimeout || 0
const timeout = configuration?.staticPageGenerationTimeout || 0
let infoPrinted = false
let exportPage: typeof import('./worker').default
let endWorker: () => Promise<void>
Expand Down
6 changes: 3 additions & 3 deletions packages/next/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export type NextConfig = { [key: string]: any } & {
webpack5?: false
strictPostcssConfiguration?: boolean
}
staticPageGenerationTimeout?: number
crossOrigin?: false | 'anonymous' | 'use-credentials'
experimental?: {
swcMinify?: boolean
Expand Down Expand Up @@ -141,7 +142,6 @@ export type NextConfig = { [key: string]: any } & {
gzipSize?: boolean
craCompat?: boolean
esmExternals?: boolean | 'loose'
staticPageGenerationTimeout?: number
isrMemoryCacheSize?: number
outputFileTracing?: boolean
concurrentFeatures?: boolean
Expand Down Expand Up @@ -198,6 +198,7 @@ export const defaultConfig: NextConfig = {
httpAgentOptions: {
keepAlive: true,
},
staticPageGenerationTimeout: 60,
experimental: {
swcLoader: false,
swcMinify: false,
Expand All @@ -206,7 +207,7 @@ export const defaultConfig: NextConfig = {
(Number(process.env.CIRCLE_NODE_TOTAL) ||
(os.cpus() || { length: 1 }).length) - 1
),
sharedPool: false,
sharedPool: true,
plugins: false,
profiling: false,
isrFlushToDisk: true,
Expand All @@ -221,7 +222,6 @@ export const defaultConfig: NextConfig = {
gzipSize: true,
craCompat: false,
esmExternals: true,
staticPageGenerationTimeout: 60,
// default to 50MB limit
isrMemoryCacheSize: 50 * 1024 * 1024,
outputFileTracing: false,
Expand Down