NextJS -哨兵CLI插件:生成ENOMEM

xbp102n0  于 2022-11-29  发布在  其他
关注(0)|答案(1)|浏览(110)

我有一个正在运行的nextjs repo,我想创建一个自动部署。但是,运行yarn build:dev有时会失败,我不知道原因。我想这是Sentry的问题。任何想法都会有帮助。谢谢。

usertest@user-test:~/user-app$ yarn build:dev
yarn run v1.22.17
warning ../package.json: No license field
$ SENTRY_ENV=testing next build
info  - Loaded env from /home/usertest/user-app/.env.local
info  - Checking validity of types  
info  - Creating an optimized production build  
Failed to compile.

Sentry CLI Plugin: spawn ENOMEM

> Build failed because of webpack errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

usertest@user-test:~/user-app$ yarn build:dev
yarn run v1.22.17
warning ../package.json: No license field
$ SENTRY_ENV=testing next build
info  - Loaded env from /home/usertest/user-app/.env.local
info  - Checking validity of types  
info  - Creating an optimized production build  
info  - Compiled successfully
Warning: You have opted-out of Automatic Static Optimization due to `getInitialProps` in `pages/_app`. This does not opt-out pages with `getStaticProps`
Read more: https://nextjs.org/docs/messages/opt-out-auto-static-optimization

info  - Collecting page data  
Page                                       Size     First Load JS
┌   /_app                                  0 B            4.88 MB
├ λ /404                                   812 B          4.88 MB
├ λ /app                                   379 B          5.18 MB
├   └ css/d0998f18980633b3.css             3.45 kB
├ λ /app/[privateKey]/[...sections]        849 B          5.18 MB
├ λ /app/[privateKey]/manage               864 B          5.18 MB
├ λ /cart                                  5.68 kB        5.13 MB
├   └ css/447237be037fa310.css             3.54 kB
├ λ /cart/success                          183 kB         5.11 MB
├   └ css/9a61a20d90862a08.css             1.53 kB
├ λ /clone/[publicKey]                     849 B          5.18 MB
├ λ /pricing/[[...step]]                   21.8 kB        5.15 MB
├   └ css/8c6576bdf86cc4f0.css             4.44 kB
└ λ /share/[publicKey]                     1.73 kB        4.96 MB
    └ css/f5297a9deccebb1d.css             2.46 kB
+ First Load JS shared by all              4.88 MB
  ├ chunks/framework-5075aff02213decd.js   42.1 kB
  ├ chunks/main-1177fbd1ad012dff.js        29.6 kB
  ├ chunks/pages/_app-4bf095f5cb645450.js  4.8 MB
  ├ chunks/webpack-03cb7ef989617708.js     3.21 kB
  └ css/457185e916b35239.css               4.34 kB

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)

Done in 124.02s.
xyhw6mcr

xyhw6mcr1#

节点进程的内存不足。请使用以下方法之一进行切换:
node app.js --max-old-space-size=8192
NODE_OPTIONS=--max-old-space-size=8192 node app.js

相关问题