I have been working on the Ionic Kitchen sync app [Ionic Conference] to build another app. It was running perfectly smooth & I have built and distributed a couple of debug.apk
to my clients as well.
Suddenly, the ionic serve
command stopped compiling and refreshing the browser on code change.
I removed the existing node_modules
folder and reinstalled it again, but that did not fix the issue!
Interestingly, the angular counterpart ng serve
is working correctly ( I am using ng serve --port 8100
precisely).
How can I fix the ionic serve
issue?
Please help!
Additional Info:
Ionic:
Ionic CLI : 6.11.0 (C: ...\npm\node_modules\@ionic\cli)
Ionic Framework : @ionic/angular 5.1.1
@angular-devkit/build-angular : 0.803.25
@angular-devkit/schematics : 8.3.25
@angular/cli : 8.3.25
@ionic/angular-toolkit : 2.2.0
@DigitalIQ Could you show the log when executing the command?
That is, the final results the ionic serve
And what do you mean by what “refreshing the browser on code change”?
@1antares1 Please review the following screenshot … the command window just stands there
Also, by “refreshing the browser on code change” - I meant that whenever we make some changes in the code and hit save, the code recompiles and serves on the browser window.
@DigitalIQ
It happens that this behavior is due to the normal “livereload” by the command: ionic serve
That is, each change you make will be reloading the changes without having to stop the service and re-running it.
ionic serve is recommended only for test environments on localhost and also for external: --external
flag.
If you want to serve content in production, run your server pointing to the /index.html located in the /dist or /www folder.
Still, anyway with the flag after: –no-livereload, it won’t refresh you for every change.
E.g.: ionic serve --no-livereload
Link reference: https://ionicframework.com/docs/cli/commands/serve#option-livereload
Best regards.
Mark the answer as a solution if it was useful to you.