Repository navigation
npm run build silently fails on OOM #1493
Copy link
Copy link
Closed
Labels
Milestone
Description
Activity
Agreed it’s an issue, do you have any idea how to solve this?
Well, it looks like
react-scripts buildrunsnode build.js, and when you send SIGTERM to the latter process (as happens with an OOM) it exits silently. Default behavior for node on SIGTERM (aka signal 15) is to exit 15. So this script is probably catching SIGTERM somewhere and exiting "gracefully."Adding
process.on('SIGTERM', function () { process.exit(15); });to the end of
react-scripts/scripts/build.jsfixes the problem. I'll add a couple more signals, console.log an error message, and submit a pull request -- cool? Is there a cleanup hook I should call?@brandones Sounds great, thanks!
- added a commit that references this issue
on Feb 7, 2017 - added a commit that references this issue
on Feb 11, 2017 Can we consider this resolved by #1496?
Going to close in hope it’s resolved but please reopen if not.
- added a commit that references this issue
on Feb 12, 2017 - added a commit that references this issue
on Feb 22, 2017 - added a commit that references this issue
on Mar 2, 2017 - added a commit that references this issue
on May 8, 2017 - added a commit that references this issue
on May 16, 2017 - locked and limited conversation to collaborators
on Jan 22, 2019
Description
When running
npm run build, if the system runs out of memory...Expected behavior
It should exit with a non-zero return code.
Actual behavior
The process exits return code 0.
Environment
npm ls react-scripts: 0.7.0node -v: v6.9.5npm -v: 3.10.10Then, specify:
Reproducible Demo
Try building on a tiny VM.
See #1026