-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Cannot build app - Javascript heap out of memory #4436
Comments
I don't think we fully support Node 10 yet. Have you tried running this with Node 8? |
I just tested with Node 8 and got the same error |
@tgreen7 does this comment help? #4536 (comment) |
Following the above mentioned comment will let you bump the memory limit. Additionally, you can reduce memory usage by implementing code splitting in your largest bundles via |
If you're running into this when using
Applying the parameter to |
Hi everyone - just checking in as I too am running into the same issue, and had performed the following directly in the Mac OS Terminal (kept on upping the memory):
My Mac Laptop has 16 GB of RAM, not running anything else but terminal. OS is 10.13.6 High Sierra. And just attempted to demonstrate building a react 360 app, but it also happens with a react native app. |
Is this a bug report?
yes
Did you try recovering your dependencies?
yes
Environment
Environment:
OS: macOS High Sierra 10.13.4
Node: 10.0.0
Yarn: 1.6.0
npm: 5.6.0
Watchman: Not Found
Xcode: Not Found
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.3.2 => 16.3.1
react-dom: ^16.3.2 => 16.3.1
react-scripts: 1.1.4 => 1.1.4
Steps to Reproduce
(Write your steps here:)
(main.js size after a successful build is 2.09 MB)
Expected Behavior
Be able to build app no problem
Actual Behavior
Build failed with error
Things I have tried:
using GENERATE_SOURCEMAP=false to build (this was mentioned in an issue). This worked for a while but then started to fail again as the app grew.
Code splitting using react-loadable to code split on routes. This might help a little with the build, but the size of our app comes more from dependencies than the code itself. Also whenever I added the dynamic import to the code it would make recompile time while developing (edit a file and save) take about 20s. This was unbearable to work with.
Unfortunately this is a private repo so I can't post the code.
The text was updated successfully, but these errors were encountered: