ionic-team / ionic-app-scripts

App Build Scripts for Ionic Projects
http://ionicframework.com/
MIT License
608 stars 302 forks source link

Hanging on "Cleaning Browser project" when executing "$ionic cordova build browser --prod" #1065

Open trakhimenok opened 7 years ago

trakhimenok commented 7 years ago

Short description of the problem:

When running $ ionic cordova build browser --prod the build seems to be succesfull but cleaning step is hanging forever. Node process consumes 99% CPU.

May be related to https://github.com/ionic-team/ionic-app-scripts/issues/1064

What behavior are you expecting?

The cleanup stage should finish in reasonable time (less than a minute?)

Steps to reproduce:

$ ionic cordova build browser --prod
Running app-scripts build: --prod --iscordovaserve --externalIpRequired --nobrowser
...
> cordova build browser
✔ Running command - done!
Running command: /Users/astec/debtstracker/ionic-apps/public/platforms/browser/cordova/build 
Cleaning Browser project

Which @ionic/app-scripts version are you using? @ionic/app-scripts: 1.3.11 See more details about my environment at https://github.com/ionic-team/ionic-app-scripts/issues/1064

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

$ ionic cordova build browser --prod
Running app-scripts build: --prod --iscordovaserve --externalIpRequired --nobrowser

[23:56:40]  build prod started ... 
[23:56:40]  clean started ... 
[23:56:40]  clean finished in 2 ms 
[23:56:40]  copy started ... 
[23:56:40]  ngc started ... 
[23:57:07]  ngc finished in 27.36 s 
[23:57:07]  preprocess started ... 
[23:57:07]  deeplinks started ... 
[23:57:12]  deeplinks finished in 5.10 s 
[23:57:12]  optimization started ... 
[23:57:13]  copy finished in 33.27 s 
[23:58:09]  optimization finished in 56.67 s 
[23:58:09]  preprocess finished in 61.78 s 
[23:58:09]  webpack started ... 
[23:58:47]  webpack finished in 37.94 s 
[23:58:47]  sass started ... 
[23:58:47]  uglifyjs started ... 
[23:58:52]  sass finished in 4.85 s 
[23:58:52]  cleancss started ... 
[23:58:55]  cleancss finished in 3.09 s 
[23:59:49]  uglifyjs finished in 62.31 s 
[23:59:49]  postprocess started ... 
[23:59:49]  postprocess finished in 34 ms 
[23:59:49]  lint started ... 
[23:59:49]  build prod finished in 189.50 s 
> cordova build browser
✔ Running command - done!
Running command: /Users/astec/debtstracker/ionic-apps/public/platforms/browser/cordova/build 
Cleaning Browser project
<-- HANGS HERE
janpio commented 7 years ago

Can you add --verbose to that command and run it again? Can you try npm run ionic:build --prod --verbose - does this also take as long? What is your ionic info output?

floriantraber commented 7 years ago

We're experiencing a similar behavior, ionic cordova build browser --prod --release --no-interactive takes more than twice as long as npm run ionic:build --prod --verbose. The build hangs for about 3 minutes at Cleaning Browser project, running with verbose provides no additional output at the offending location.

janpio commented 7 years ago

Do you really need to use ionic cordova build browser at all? ionic build also builds a web version, but without the Cordova browser platform. It should be much faster.

floriantraber commented 7 years ago

It appears I don't need to :man_facepalming:. That solves the problem for me, thanks!

janpio commented 7 years ago

The command is new since Ionic CLI 3.7 - so no wonder it is not as known yet ;)

rdbossjr commented 7 years ago

We have the same issue but Cordova is required. The Cleaning Browser project section is taking 10 to 15 minutes.

janpio commented 7 years ago

The "Cleaning Browser project" is not directly part of Ionic but probably done by Cordova CLI. Best location to report this would be http://issues.cordova.io/ then. (Note that your issue there has higher chance of being handled if it doesn't include Ionic and can also be reproduced with a plain Cordova app - maybe try to reproduce it with a new Cordova project and cordova build ... first.)