next.js: Build error on Now deployment

  • [x ] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Trying to deploy with now-cli

Current Behavior

Deployment process end with error

Deploying ******

Using Node.js 8.9.1 (default) Ready! https://****** [4s] Initializing… Building ▲ npm install ✓ Using “package-lock.json” ⧗ Installing 48 main dependencies… ✓ Installed 1119 modules [34s] ▲ npm run build

visual_proposal@1.0.0 build /home/nowuser/src next build Using external babel configuration Location: “/home/nowuser/src/.babelrc” Using “webpack” config function defined in next.config.js. npm ERR! code ELIFECYCLE npm ERR! errno 137 npm ERR! visual_proposal@1.0.0 build: next build npm ERR! Exit status 137 npm ERR! npm ERR! Failed at the visual_proposal@1.0.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! /home/nowuser/.npm/_logs/2017-12-06T08_26_26_403Z-debug.log

Steps to Reproduce (for bugs)

  1. clone repo https://github.com/psycura/VisualProposal
  2. try to deploy to now

Your Environment

Tech Version
next 4.2.0
node 8.9.1
OS windows 10
browser chrome

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

@MarkLyck just checked it out, the cause is the instance running out of memory while building. I’ve checked your app and it looks like you have non-pages inside of the pages directory. This basically causes the amount of processing webpack has to do to grow tremendously. From the test on my laptop next build peaked at 1,3GB memory. OSS plan instances have 500MB memory available. Paid plan instances have 1GB memory.

My recommendation is to move all non-pages to a separate folder. It’ll both make the build faster (232s on my macbook pro 2017 right now) and use way less memory.

@MarkLyck @calvinchankf checking this out today 👍