Open Bengejd opened 6 years ago
Yep doing npm install latest versions of webpack and build-optimizer seems to be fixing the problem with firebase's libs
It would be nice to see something from Ionic on this and other V3 related issues. Maybe an update to ionic-app-scripts or a path to use the angular-cli for v3 projects. I've been following many issues, some even with PRs but they seem to get no attention since all of the focus is on V4.
It's unfortunate, because event after the V4 there will be a large portion of the community that will not be able to migrate to V4 even once it's officially released, at least for a period of time. When AngularJS went towards Angular 2 they announced a plan to monitor the community and provide support for AngularJS until Angular 2 hit a certain adoption rate IIRC.
Some hints to notify eveybody,
NODE_OPTIONS was landed in 8.x+ , if you want to use NODE_OPTIONS, remember to upgrade ur node how to upgrade
in Mac, without 8.x node, what I did is: $ which ionic /usr/local/bin/ionic $ nano /usr/local/bin/ionic at first line , change
to
then, you can compile as usual $ ionic cordova build ios --prod --release $ npm run ionic:build --prod --release
The best way is using NODE_OPTIONS in your .bash_profile, added export NODE_OPTIONS=--max-old-space-size=4096
I DON'T recommend escape --optimizejs, using command below won't reference to you "prod" ENV, if you have one. It runs without webpack 'prodConfig', I don't know what were lost. $ npm run ionic:build --minifyjs --minifycss --release --aot (X not recommended)
How to know that your problem is really caused by Heap Size Limit ? first, run below command without success $ node /usr/local/bin/ionic cordova build android --prod --release run below command with success $ node --max-old-space-size=4096 /usr/local/bin/ionic cordova build android --prod --release
Downgrade solution didn't works for me.
This one works for me : ionic cordova build android --aot --minifyjs --minifycss --release
🙂
Thanks to @bnfrnz
This issue begin after firebase@4.13.0 & 4.13.1 downgrade your firebase to firebase@4.12.1.
You can also use the latest firebase@5.0.3 and downgrade your @firebase/database to @firebase/database@0.2.1
This issue is on their github
@mfahrul thanks for the help. Working
I'm facing the same issue. Wasted days on trying to build with
--prod
. Made sure all imports are deep and accurate, increased memory size, stack size... basically tried all the advice I could find in the dozens of prod build related github issues I found across the various related repos... nothing helped. The prod build always freezes and all I can do is kill the process after a few hours.Unfortunately, the README.md of this repo appears to be a bit outdated and not very helpful. The
--cleancss
and--uglifyjs
flags for example don't seem to be supported by the latest version. I was trying to find out what exactly--prod
actually does and it seems to me that it includes--optimizejs
. I played around with the options and in my case this optimize script is the one that hangs.@Bengejd, @ayaka209, If you also can't sort out the
--prod
build but urgently need a build, try leaving out--optimizejs
option. I guess it's not ideal but for me it works and I just couldn't find another way.Basically, instead of this
ionic cordova build ios --prod
do thisionic cordova build ios --aot --minifyjs --minifycss --release
Would be great to find out why exactly
--optimizejs
doesn't work for me and be able to fix it since it is my understanding that it's supposed to bring performance improvements...
This is the most effective answer till today. I confirm
Short description of the problem:
When running
ionic cordova build ios --prod
the command starts running, but then (seemingly) stops afterWhat behavior are you expecting?
For the build process to continue, like it does when you run
ionic cordova build ios
Steps to reproduce:
Package.Json
Which @ionic/app-scripts version are you using? 3.1.9
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
This was seemingly fixed in the 3.1.9 update of @ionic/app-scripts. But I'm still running into this issue after upgrading from 3.1.8.