Error: Collecting page data for /dashboard/widget is still timing out after 2 attempts nextjs

Error: Collecting page data for /dashboard/widget is still timing out after 2 attempts nextjs

当我尝试为 nextjs 构建代码时它显示

info  - Compiled successfully
warn  - Restarted collecting page data for /dashboard/widget because it took more than 60 seconds
warn  - See more info here https://nextjs.org/docs/messages/static-page-generation-timeout

> Build error occurred
Error: Collecting page data for /dashboard/widget is still timing out after 2 attempts. See more info here https://nextjs.org/docs/messages/page-data-collection-timeout
    at onRestart (C:\PERSONAL\projects\admin\node_modules\next\dist\build\index.js:444:31)
    at Worker1.isPageStatic (C:\PERSONAL\projects\admin\node_modules\next\dist\lib\worker.js:49:40)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Span.traceAsyncFn (C:\PERSONAL\projects\admin\node_modules\next\dist\telemetry\trace\trace.js:60:20) 
    at async C:\PERSONAL\projects\admin\node_modules\next\dist\build\index.js:506:48
    at async Span.traceAsyncFn (C:\PERSONAL\projects\admin\node_modules\next\dist\telemetry\trace\trace.js:60:20) 
    at async Promise.all (index 24)
    at async C:\PERSONAL\projects\admin\node_modules\next\dist\build\index.js:491:13
    at async Span.traceAsyncFn (C:\PERSONAL\projects\admin\node_modules\next\dist\telemetry\trace\trace.js:60:20) 
    at async C:\PERSONAL\projects\admin\node_modules\next\dist\build\index.js:468:127
    at async Span.traceAsyncFn (C:\PERSONAL\projects\admin\node_modules\next\dist\telemetry\trace\trace.js:60:20) 
    at async Object.build [as default] (C:\PERSONAL\projects\admin\node_modules\next\dist\build\index.js:77:25)   
info  - Collecting page data .npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! admin@0.1.0 build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the admin@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\sgarg\AppData\Roaming\npm-cache\_logs22-04-12T08_11_02_994Z-debug.log

代码编译成功,未显示任何错误进行整理。可能的问题是什么?

来自官网

Increase the timeout by changing the staticPageGenerationTimeout configuration option (default 60 in seconds).

所以我将 next.config.js 中的 staticPageGenerationTimeout 更新为 100 秒。

成功了。