ionic-cli: Live reload doesn't work

Description: ionic serve or ionic serve -r or ionic serve --livereload-port doesnt refresh the build when any HTML or ts file is changed

Steps to Reproduce: Do ionic serve and change any html or ts file

Example repo: N/A

My ionic info: cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 7.0.1 

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : browser 4.1.0
Ionic Framework    : ionic-angular 3.6.0

System:

Android SDK Tools : 26.0.2
Node              : v8.4.0
npm               : 5.3.0 
OS                : Linux 4.10

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 24 (8 by maintainers)

Most upvoted comments

@dwieeb , Thanks for your quick response. Actually, I am working on multiple projects(most of them are complex, but have same problem). Of course, they don’t include spaces in paths. I am sure it works well on the empty project.

This will be the steps to reproduce it:

  1. Open ionic project.
  2. Start ionic serve
  3. Update src/ , and live reload is working and should show latest updates, but it sometimes shows old version before I changed. This makes me to force ionic serve and try again. Any problem with cache data?

PS: I am using ionic cli@latest because it asks me to update everyday before I start to work.

Just learned about Stencil and when using demo found that I have error from node.js ENOSPC (not enough space on the drive but I have more than need)

After that I just looked at different issues and found this one:

On Linux (or Mac) we have a max number of system watchers we can place at an IO level (from my understanding). So for large projects, it seems that Jest is trying to watch just way to many files.

To fix:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

And after that livereload again works for project that before has no reaction.

@sdey0081 From what you’ve described, my guess is you’re experiencing an issue with your service worker. To verify, in Chrome debugger, go to Application -> Service Workers and click stop. You should also comment out the service worker in your src/index.html to disable it and verify that live reload is working without it.

If you’re new to service workers, you can check out these articles: