Livereload not working with run but it works on serve


#1

Hi there, i decided to start our new project with ionic2. But there is something wrong with livereload.
After couple hours stackoverflow and ionic forum adventure, finally i’m here.

All solutions depending on gulp. But i cannot see a gulp file on project root.

i found watch.config.js file at myapp/node_modules/@ionic/app-scripts/config/watch.config.js

i believe it is watching only myapp/www folder. But all pages, scripts, ts files are in myapp/src folder. i cannot figure out how it might be. even official docs shows that src contents in www folder, but when i start a blank project it coming seperate.

i’m not good at gulp or watchers, actually i’m not a frontend developer either. just loved and publish a few apps with angular & ionic and personally needed to learn v2 of both.

Best,
Onur.


#2

I just wanted to reply that I’m experiencing the same issue. Similarly, I’m also new to Angular 2, Ionic and Gulp.

For me I noticed if I manually change something temporarily in the /www directory live reload will show the changes but editing and saving files in /src doesn’t appear to trigger live reloading. I assume it’s supposed to transpile part of /www automatically after files in /src are edited? In case it helps anyone solve the issue here’s my ionic info (I’ve tried both Windows/OSX and both Node 4.x/6.x versions):

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.30
OS:
Node Version: v4.6.1

Thanks!
Jesse


#3

Hello again, sorry for the double post but I resolved my own problem. For me the issue was I was building within a directory that had a folder name with special characters like: Dropbox (Personal)

Moving to a simpler path fixed livereloading for me. Hope this helps others.


#4

Thanks for feedback. But still same is here.

Directory :
/Users/monur/Desktop/noSpecialChars

ionic serve works like a charm but no luck for ionic run ios --device -l


#5

solved the problem but its not very efficient.

changed
"scripts": {

“run:before”: “build”

},

to

“run:before”:“watch”

in package.json

its working but 4-5s delaying. This is so annoying.

if one of ionic team had helped me, it would be nice.


#6

I am facing the same issue, run doesnt live reload while serve does.