错误:下一次尝试2次后,收集/dashboard/widget的页面数据仍然超时



当我尝试为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:PERSONALprojectsadminnode_modulesnextdistbuildindex.js:444:31)
at Worker1.isPageStatic (C:PERSONALprojectsadminnode_modulesnextdistlibworker.js:49:40)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Span.traceAsyncFn (C:PERSONALprojectsadminnode_modulesnextdisttelemetrytracetrace.js:60:20) 
at async C:PERSONALprojectsadminnode_modulesnextdistbuildindex.js:506:48
at async Span.traceAsyncFn (C:PERSONALprojectsadminnode_modulesnextdisttelemetrytracetrace.js:60:20) 
at async Promise.all (index 24)
at async C:PERSONALprojectsadminnode_modulesnextdistbuildindex.js:491:13
at async Span.traceAsyncFn (C:PERSONALprojectsadminnode_modulesnextdisttelemetrytracetrace.js:60:20) 
at async C:PERSONALprojectsadminnode_modulesnextdistbuildindex.js:468:127
at async Span.traceAsyncFn (C:PERSONALprojectsadminnode_modulesnextdisttelemetrytracetrace.js:60:20) 
at async Object.build [as default] (C:PERSONALprojectsadminnode_modulesnextdistbuildindex.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:UserssgargAppDataRoamingnpm-cache_logs2022-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秒。

它奏效了。

最新更新