0

I have a working nextjs repo and I want to create an automated deployment. However, running yarn build:dev is sometimes failing and I don't have an idea of its cause. I'm thinking this is an issue with Sentry. Any ideas will help. Thanks.

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.

1 Answer 1

1

You are running out of memory for the node process. Bump it with one of:

node app.js --max-old-space-size=8192

NODE_OPTIONS=--max-old-space-size=8192 node app.js

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.