Ionic-framework: [Ionic v4.0.0-beta.8] ionic serve refresh very slow

Created on 7 Sep 2018  Â·  18Comments  Â·  Source: ionic-team/ionic-framework

Bug Report

Describe the Bug
ionic serve takes very long to refresh on file change

Steps to Reproduce
Using beta5 I had a refresh-time of about 12sec.
With the beta8, the refresh-time got up to 52sec.

triage

Most helpful comment

Upgrading to nodejs 10 also solved the problem for me :)

All 18 comments

Just assumed that that was webpack doing an insane amount of IO.

I'd be amazed if incremental compilation actually worked to the point where code changes don't incur 10s of seconds wait times.

Well yeah even 12 secs is bad - but this ticket is about the huge increase in compilation time from beta5 to beta8... something must have changed within these versions.

I for now got back to beta5 for active development.

I can concur with this issue, with beta.7 average ng serve rebuild time is ~10s and after installing beta.8 it jumps to ~40s

Yes same for more

Ok - first I'd like to state this is NOT an issue with Ionic at all.

I have two projects in Ionic beta.8 and before I made adjustments to my machine, one took 17s to reload and the other took 26s+. After fixing configuration issues I am down to 2-3s MAX for rebuild. This same issue effected 1 of my devs, but another dev has zero problems (plus another machine I tested against); so it's definitely not a project issue, but a user-specific issue.

For my specific problem, I had to delete fisherman and fnm which is a package manager tool for handling multiple versions of node. After rebuilding my global npm modules (include rebuilding node-sass), all my problems resolved themselves.

Here is my dependency specs for reference:
```

npm -v
6.4.1
node -v
v10.10.0
ng --v
Your global Angular CLI version (6.2.1) is greater than your local
version (6.1.5). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ â–³ \ | '_ \ / _| | | | |/ _ | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ __| |_|__, |__,_|_|__,_|_| ____|_____|___|
|___/

Angular CLI: 6.1.5
Node: 10.10.0
OS: darwin x64
Angular: 6.1.7
... animations, common, compiler, core, forms, language-service
... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.7.5
@angular-devkit/build-angular 0.7.5
@angular-devkit/build-optimizer 0.7.5
@angular-devkit/build-webpack 0.7.5
@angular-devkit/core 0.7.5
@angular-devkit/schematics 0.7.5
@angular/cdk 6.4.1
@angular/cli 6.1.5
@angular/compiler-cli 6.1.6
@angular/flex-layout 6.0.0-beta.18
@angular/material 6.4.7
@ngtools/webpack 6.1.5
@schematics/angular 0.8.1
@schematics/update 0.7.5
rxjs 6.3.2
typescript 2.9.2
webpack 4.9.2

I downgraded to beta 7 and is very fast again.

If any of you would provide npm, node, angular-cli, etc. versions; that would actually help solve the problem on your machine.

Having the same issue, moved back to beta.7 and live reload went from 21 seconds to 4 seconds
Ionic info

Ionic:

   ionic (Ionic CLI)          : 4.0.5 (/usr/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.7
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.2.1
   @ionic/ng-toolkit          : 1.0.8
   @ionic/schematics-angular  : 1.0.6

System:

   NodeJS : v9.8.0 (/usr/bin/node)
   npm    : 6.4.0
   OS     : Linux 4.9

edit: Solved by upgrading to node 10

@sean-perkins

Ionic:

ionic (Ionic CLI)          : 4.0.1 (/usr/lib/node_modules/ionic)
Ionic Framework            : @ionic/angular 4.0.0-beta.7
@angular-devkit/core       : 0.7.5
@angular-devkit/schematics : 0.7.5
@angular/cli               : 6.1.0
@ionic/ng-toolkit          : 1.0.7
@ionic/schematics-angular  : 1.0.3

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms     : android 7.0.0, ios 4.5.5

System:

Android SDK Tools : 25.2.5
NodeJS            : v9.11.2 (/usr/bin/node)
npm               : 5.6.0
OS                : Linux 4.4

@crebuh Can you upgrade Node to 10.10.0 and npm to ~6.4.0? Report back if the times improve.

It's fair to mention I'm on MacOS.

Same on beta 11, takes about 30 seconds to build even the simplest of changes; in fact, even saving a file with no changes incurs a 28.5 second hit.

Something's obviously not right.

Ionic:

   ionic (Ionic CLI)          : 4.1.2
   Ionic Framework            : @ionic/angular 4.0.0-beta.11
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.2.2
   @ionic/ng-toolkit          : 1.0.8
   @ionic/schematics-angular  : 1.0.6

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.1.1, browser 5.0.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.0.3, (and 7 other plugins)

System:

   NodeJS : v9.11.1 (/path/to/.nvm/versions/node/v9.11.1/bin/node)
   npm    : 6.4.1
   OS     : Linux 4.16

Blew away nvm along with all downloaded node packages, and then installed nodejs 10.10.0 from dnf repository (on Fedora 28).

Reinstalled node packages and now minor code changes take around 3 seconds to rebuild.

Not sure what exactly was the cause, but can now get back on the Ionic beta train :)

Upgrading to nodejs 10 also solved the problem for me :)

I am testing out Ionic 4 and the compile time it's super slow also for me, around 1min for each reload:

screen shot 2018-10-17 at 17 07 22

npm: 6.4.1
node: 10.12.0
Ionic version: I have tried with version 4.beta21 and to downgrade to 4.beta7 but didn't speed up.

I also tried to delete nmv as suggested but didn't help.

Any clue?

At the moment it's impossible to work with :(

There's no such thing as beta 21, 13 is the latest.

Take it over to the Slack channel: https://ionic-worldwide.slack.com/messages/C03AJV5A5/

Post your ionic info over there.

Oh sorry for the confusion. Yeah it was beta.13
I managed to fix!

  • I have reinstalled Node using the installer
  • remove and reinstall all node_modules
  • npm rebuild node-sass

And now it's fast again!

At the moment it's super fast using the beta.7 version, around 2secs:

screen shot 2018-10-17 at 18 35 33

And a bit slower using the beta.13 version, around 7secs, but still acceptable:

screen shot 2018-10-17 at 18 35 45

Ionic info:

screen shot 2018-10-17 at 18 37 25

I has another application in Ionic 3, if I upgrade node to 10, Ionic 3 will continue working?

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gio82 picture gio82  Â·  3Comments

MrBokeh picture MrBokeh  Â·  3Comments

SebastianGiro picture SebastianGiro  Â·  3Comments

alan-agius4 picture alan-agius4  Â·  3Comments

RobFerguson picture RobFerguson  Â·  3Comments