reactjs - nextjs 生产构建失败
问题描述
在为 nextjs 应用程序的生产构建运行 npm run build 时,我收到此错误
警告:您已选择退出自动静态优化,因为getInitialProps
. pages/_app
这不会选择退出页面getStaticProps
阅读更多:https ://err.sh/next.js/opt-out-auto-static-optimization
自动优化页面.. 预渲染页面“/404”时发生错误。阅读更多:https ://err.sh/next.js/prerender-error:TypeError:无法读取未定义的“加密”属性
预呈现页面“/”时发生错误。阅读更多:https ://err.sh/next.js/prerender-error:TypeError:无法读取未定义的“加密”属性
预呈现页面“/404.html”时发生错误。阅读更多:https ://err.sh/next.js/prerender-error:TypeError:无法读取未定义的“加密”属性
发生构建错误错误:导出在 _default (/home/osis/raj_server/mobile-web/node_modules/next/dist/export/index.js:19:1164) 在 processTicksAndRejections (internal/process/task_queues.js:97) 遇到错误:5) 在异步构建 (/home/osis/raj_server/mobile-web/node_modules/next/dist/build/index.js:36:218) 自动优化页面.npm ERR!代码 ELIFECYCLE npm 错误!errno 1 npm 错误!mobile-web@0.1.0 构建:
next build
npm 错误!退出状态 1 npm ERR!npm 错误!在 mobile-web@0.1.0 构建脚本中失败。npm 错误!这可能不是 npm 的问题。上面可能有额外的日志输出。
npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!/home/osis/.npm/_logs/2020-06-12T12_20_18_063Z-debug.log
解决方案
推荐阅读
- asp.net - 如何将自定义库添加到 ASP.NET MVC
- excel - 根据源单元格更改图表颜色(条形图)(使用条件格式和 VBA)
- javascript - 续集:在 DATE 使用 LIKE
- c++ - 包括具有一级间接的标题?
- javascript - 如何从firebase实时更新状态?| 反应.js
- snakemake - snakemake 将文件夹定义为输出
- xpath - 有没有办法通过 Xpath 切换到 JMeter 脚本来运行部分脚本
- javascript - 如何使用 jQuery/JavaScript 仅在特定页面上将 h3 更改为 h2
- angular - 如何让我的 Jasmine 测试在 mergeMap 中达到这个回调?
- javascript - Uncaught SyntaxError: Unexpected token export - 如何设置库