-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Babel-node doesn't respect --max_old_space_size
option when working with cluster
#12635
Comments
Hey @ryancat! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
I can not reproduce this error on my local build. As babel/packages/babel-node/src/babel-node.js Lines 55 to 60 in fec4a13
You can add the following snippets
before
Can you attach your log output after you edit |
@JLHwung Thanks for looking into this. I used htop to check my code and found the The example code on repl.it that I linked in the issue do not have
You will notice the code failed with OOM exceptions. If you run the same script use node by itself, it works.
|
Okay I can reproduce the error. Instead of testing |
Posted an upstream issue nodejs/node#36948 as I can't figure out how to fix it on Babel side. As a workaround mentioned by OP, please use |
Bug Report
Current behavior
This are some codes on REPL that shows the error. Basically, babel-node doesn't respect the
--max_old_space_size
option when running with cluster. The out of memory exception will throw regardless of the extra memory allocated. Running without cluster everything works.Expected behavior
Babel-node should work with cluster as well when
--max_old_space_size
is provided.Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
Just install
@babel/node
and@babel/core
.Environment
Possible Solution
The only solution right now is to add
NODE_OPTIONS=--max-old-space-size=4096
beforenode
.The text was updated successfully, but these errors were encountered: