You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allocation failed - JavaScript heap out of memory #1453
I've gotten this too while using ionic serve. Specifically while making changes really quick to the codebase as I was migrating to RC0. Maybe saving files too quickly?
@tlaverdure ionic serves performs well on the first try. But yes, if i change files quickly this runs into error too. But here the ionic run/ionic build query doesn't work at all. It always crashes at the bundle step... I tried the stock tab app, this works fine...
Hello all! I am going to close this issue for now as it has been fixed in ionic-app-scripts v0.0.30. To update your project to the latest version of ionic-app-scriptsjust runnpm install` inside your project. Thanks!
@tamerbak I was running into the same issue, the only thing that I could work around this issue was to edit top of the file ./node_modules/lib/@ionic/app-scripts/bin/ionic-app-scripts.js and add the following to the top of the file: #!/usr/bin/env node --max-old-space-size=4096
@drewhawken, Thanks for this workaround, this is what I did finally.. But I had to downgrade ionic CLI version to 2.2.1 to overcome this issue.
I should notify that, I'm working on another application with less pages, and this issue doesn't appear, with the last beta version of ionic CLI and without your workaround.
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.
@drewhawken, thanks, I've tried your solution which properly worked-around the issue. But the issue occurred on our build machine (one Mac mini), the build dir got wiped every time and I need a global permanent configuration, for the moment I found this tiny tool can do the trick, I added it to our pre-build hook.
Anyway, hopefully there will be a cli option since ionic itself will get upgraded sometimes, the environment would change as well sometimes.
Activity
tlaverdure commentedon Oct 3, 2016
I've gotten this too while using
ionic serve. Specifically while making changes really quick to the codebase as I was migrating to RC0. Maybe saving files too quickly?Lingomat commentedon Oct 3, 2016
Related to #1433 ?
chack commentedon Oct 3, 2016
@tlaverdure ionic serves performs well on the first try. But yes, if i change files quickly this runs into error too. But here the ionic run/ionic build query doesn't work at all. It always crashes at the bundle step... I tried the stock tab app, this works fine...
@Lingomat Maybe...
chack commentedon Oct 3, 2016
I changed following line in package.json:
"build": "ionic-app-scripts watch",into
"build": "node --max-old-space-size=2048 ./node_modules/.bin/ionic-app-scripts build",now it works!
jthoms1 commentedon Oct 3, 2016
@chack That will work for now, but we are aware of this issue still occuring and are working on a fix.
Can I get a more detailed capture (more lines of output) of your command lines before the failure. This should help in troubleshooting.
Thanks!
gfviegas commentedon Oct 5, 2016
@jthoms1 not to mention this heap out of memory is happening way too often but the whole build it's also way too slow...
Anyway, i'm getting this after some changes .. here are my lines of output in ionic serve command:
rico commentedon Oct 7, 2016
Experiencing the same:
Using
ionic/app-scripts@0.0.28.jgw96 commentedon Oct 12, 2016
Hello all! I am going to close this issue for now as it has been fixed in
ionic-app-scriptsv0.0.30. To update your project to the latest version of ionic-app-scriptsjust runnpm install` inside your project. Thanks!arturalkaim commentedon Feb 28, 2017
Hello!
I'm having this issue
Any help?
Thanks
ionic infooutput:drewhawken commentedon Mar 8, 2017
@arturalkaim I upgraded typescript to 2.0.10 and it worked for me.
tamerbak commentedon Mar 15, 2017
Same problem..
(typescript 2.0.9)
webpack finish in 247 s !
Upgrading to typescript 2.0.10 doesn't resolve the problem. (Even the last version 2.2.1)
drewhawken commentedon Mar 18, 2017
@tamerbak I was running into the same issue, the only thing that I could work around this issue was to edit top of the file ./node_modules/lib/@ionic/app-scripts/bin/ionic-app-scripts.js and add the following to the top of the file:
#!/usr/bin/env node --max-old-space-size=4096tamerbak commentedon Mar 20, 2017
@drewhawken, Thanks for this workaround, this is what I did finally.. But I had to downgrade ionic CLI version to 2.2.1 to overcome this issue.
I should notify that, I'm working on another application with less pages, and this issue doesn't appear, with the last beta version of ionic CLI and without your workaround.
timothybclayton commentedon Jul 7, 2017
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" (
"%~dp0\node.exe" --max_old_space_size=8048 "%~dp0\node_modules\ionic\bin\ionic" %*
) ELSE (
@SETLOCAL
@set PATHEXT=%PATHEXT:;.JS;=;%
node --max_old_space_size=8048 "%~dp0\node_modules\ionic\bin\ionic" %*
)
Good luck!
AnkitMaheshwariIn commentedon Jul 11, 2017
@timothybclayton Thanks for posting your solution! This modification in ionic.cmd worked for me.
qiluo commentedon Aug 9, 2017
ran into same issue, here's my info
How to workaround it on OSX? Thanks
drewhawken commentedon Aug 9, 2017
@qiluo if you take a look at my previous comment, I had to reimplement it for this build of the tool.
Adding the following to ./node_modules/lib//bin/ionic-app-scripts.js:
#!/usr/bin/envnode --max-old-space-size=4096qiluo commentedon Aug 10, 2017
@drewhawken, thanks, I've tried your solution which properly worked-around the issue. But the issue occurred on our build machine (one Mac mini), the build dir got wiped every time and I need a global permanent configuration, for the moment I found this tiny tool can do the trick, I added it to our pre-build hook.
Anyway, hopefully there will be a cli option since ionic itself will get upgraded sometimes, the environment would change as well sometimes.
imhoffd commentedon Aug 10, 2017
If on macOS or linux, this might work (untested):
put this in
.bashrcand open a new terminal:biranchi2018 commentedon Apr 7, 2018
Still occurs in ionic/app-scripts": "3.1.8
dgutierrez1 commentedon Apr 20, 2018
Still occurs in:
ionic/app-scripts": "3.1.9",
Ionic CLI Version: "3.20.0"
YousefRabieKhalil commentedon Apr 27, 2018
Still occurs in:
ionic/app-scripts": "3.1.9",
Ionic CLI Version: "3.20.0"
alutsu commentedon Jun 13, 2018
Still occurs in:
ionic/app-scripts": "3.1.10"