首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >错误:为/dashboard/小部件收集页面数据,在2次尝试nextjs后仍在超时。

错误:为/dashboard/小部件收集页面数据,在2次尝试nextjs后仍在超时。
EN

Stack Overflow用户
提问于 2022-04-12 08:25:15
回答 1查看 2.1K关注 0票数 0

当我试图为nextjs构建代码时,它将显示

代码语言:javascript
运行
复制
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\_logs\2022-04-12T08_11_02_994Z-debug.log

代码编译是成功的,它没有显示出任何错误的排序。可能的问题是什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-04-13 15:14:24

从官方网站

代码语言:javascript
运行
复制
Increase the timeout by changing the staticPageGenerationTimeout configuration option (default 60 in seconds).

因此,我将next.config.js中的staticPageGenerationTimeout更新为100秒。

而且起作用了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71839345

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档