[Ionic 5] Not working: Live Reload

The problem

When using ionic cap run web -l --ssl the project loads and runs just fine; however any changes made in VS Code do not cause a live-reload to occur.

Versions

Windows 10: v2004
WSL: 2
VS Code: 1.48.2
@ionic/angular: ^5.3.2
@ionic-native/core: ^5.28.0
cordova: ^9.0.0

Efforts made

  1. Running ionic cap run web -l --ssl --host=0.0.0.0
  2. Adding "server": { "url": "https://localhost:8100" } to capacitor.config.json
  3. Creating a new project
  4. Moving the project to ~/
  5. Increasing watchers: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p && sudo sysctl --system
  6. Deleting /www
  7. Updating all npm libs to the latest version
  8. Running ionic cordova run browser -l
  9. Running npx cap serve
  10. Changing "webDir": "www" to "webDir": "src" in capacitor.config.json

I haven’t had any success with the above and am currently stuck. Any ideas?

@codebuilt And did you try with the following command?
ionic capacitor run --livereload-url

On what platform do you want to run the app with live-reload?

As it turns out, the problem was creeping up because I was running the project on an NTFS drive while using WSL. Moving the project to ~/ decreased compile time and for some reason now works. I tried doing this before, but I copied the files instead of cloning the project.

2 Likes