-
Notifications
You must be signed in to change notification settings - Fork 311
Ionic run android --prod with error Javascript heap out of menory #766
Comments
Wow, that is a huge app! The solution in your PR seems valid. Does it fix the problem for you? Thanks, |
@danbucholtz It dont. I added --max_old_space_size=2048 or 8000 in
but the error still show up. I do not know I added the correct file anymore. Code insert:
|
Try it from your package.json scripts section:
Same with build. I think that will work for you. Please play around with that and let me know how it goes. Thanks, |
@danbucholtz I add this in package.json scripts section:
Please help me, thanks!!! |
@danbucholtz Having the same error when trying to build with --prod flag. Tried changing max_old_space_size to 2048, even to 4096 did not help. Also, reading through other similar reports, tried to reduce amount of sass color variables, but that did not help either, even with only 3 colors defined, same error appeared. As the error is not very informative, could not trace the part that's causing this. Tried using all versions of app-scripts from 1.0.0 up to the latest with no luck. As in some other cases, rolling back to app-scripts <= 0.0.46 builds just fine. My app has over 60 pages, ~20 reusable components and some other stuff like services, pipes, directives, etc., so i guess it could be closely related to the reported issue. |
@themastersoda
|
@badboy91vn i don't use ng2-translator, and I tried all the other things you mentioned, but thanks for help :) |
I've was able to workaround this issue on Ionic v3.5, Ionic cli 3.4.0, and Node.js 6.9.1. We have a big app with lots of modules and heap space errors occurring every build, whether "ionic serve", or "ionic cordova run --prod". Modify your ionic.cmd file in C:\Users<user>\AppData\Roaming\npm by adding --max_old_space_size. I set mine to 8096. @if EXIST "%~dp0\node.exe" ( Good luck! |
Note: for support questions, please use one of these channels:
https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/
Short description of the problem:
What behavior are you expecting?
execute ionic run android --prod or ionic build android --prod --release with no error.
Steps to reproduce:
Which @ionic/app-scripts version are you using?
i use v1.0.0 , v1.1.0 , v.1.1.2, v.1.1.3. All show same error
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
The text was updated successfully, but these errors were encountered: