ionic-cli: bug v2: "ionic run browser --livereload" is not refreshing the app after changes

  • to reproduce
    • run ionic run browser --livereload
    • modify a html or ts file
  • expected
    • the app should change. Refreshing the browser you should see the changes
  • instead
    • the console shows that the file changes is being copied by the changes are not reflected in the app. It is still necessary to ctrl+c and restart it
  • workaround: after the change, wait until when the console shows the file changed and then rsync -rtv www/ platforms/browser/www or run another file watcher: fswatch -r www/ | xargs -I % rsync -rtv www/ platforms/browser/www
  • workaround 2 ./node_modules/.bin/ionic-app-scripts serve --sourceMap source-map --iscordovaserve --wwwDir platforms/browser/www/ --buildDir platforms/browser/www/build

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 13
  • Comments: 28 (3 by maintainers)

Most upvoted comments

From @sebastianovide answer

Workaround: ./node_modules/.bin/ionic-app-scripts serve --sourceMap source-map --iscordovaserve --wwwDir platforms/browser/www/ --buildDir platforms/browser/www/build

He forced the ionic app script to serve and build the www from ./platform/browser instead of serving from ./www folder

for the shorter command, you can edit the package.json in the scripts key like this:

"scripts": {
    "build": "ionic-app-scripts build",
    "clean": "ionic-app-scripts clean",
    ...
    "browser": "ionic-app-scripts serve --sourceMap source-map --iscordovaserve --wwwDir platforms/browser/www/ --buildDir platforms/browser/www/build"
},

and then on the terminal, you just need to run npm run browser

now you got the browser version of your app that compatible with cordova

Workaround: ./node_modules/.bin/ionic-app-scripts serve --sourceMap source-map --iscordovaserve --wwwDir platforms/browser/www/ --buildDir platforms/browser/www/build

@jthoms1 I believe we should re-open this issue because it seems this bug still exist in the latest version of the code.

I ran into this issue today with ionic CLI 2.2.1

$ ionic info

Your system information:

Cordova CLI: 6.4.0 
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0 
ios-sim version: 5.0.13 
OS: macOS Sierra
Node Version: v7.4.0
Xcode version: Xcode 8.2 Build version 8C38

+1. Also, I’ve double-checked my ionic address. This feature was functioning earlier, but has unexpectedly stopped. Any feedback?

Nope… sorry. It worked well for the first hour and here is the issue again 👎

Having the same issue (‘ionic run browser --livereload’ not reloading on template change):

Cordova CLI: 7.0.0 Ionic Framework Version: 3.1.1 Ionic CLI Version: 2.2.3 Ionic App Lib Version: 2.2.1 Ionic App Scripts Version: 1.3.7 ios-deploy version: Not installed ios-sim version: Not installed OS: Linux 4.10 Node Version: v6.10.2 Xcode version: Not installed

Please, fix this problem, as it severely impedes fast prototyping.

Having the same issue as described an reported by others here.

Having the same issue. Mostly with templates update

Exactly the same with new version

Same issue on ubuntu 16.04:

Cordova CLI: 6.5.0 Ionic Framework Version: 2.0.1 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.1.3 ios-deploy version: Not installed ios-sim version: Not installed OS: Linux 4.4 Node Version: v7.4.0 Xcode version: Not installed

Please install the latest ionic cli. ionic@2.1.12. This has incorporated the test tag branch. Thanks for your patience. If you are still having issues please let me know!

npm uninstall -g ionic npm install -g ionic@latest

Same here

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 6.5.0 
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.8
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : browser 4.1.0
Ionic Framework                 : ionic-angular 3.4.2

System:

Node       : v6.11.0
OS         : Linux 4.4
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 3.10.10 

Same issue than @zixia

I’m having an issue with the project failing to build after making a change in src/.

When I run ionic run browser --livereload, it builds fine and opens Chrome etc., but after making a change in a html/scss/ts file, it fails like this:

[14:49:06]  build started ... 
(node:39480) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'send' of undefined
[14:51:37]  build started ... 
(node:39480) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'send' of undefined
[14:51:43]  build started ... 
(node:39480) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Cannot read property 'send' of undefined
$ ionic info

Your system information:

Cordova CLI: 6.4.0 
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.48
ios-deploy version: 1.9.0 
ios-sim version: 5.0.13 
OS: macOS Sierra
Node Version: v6.9.2
Xcode version: Xcode 8.1 Build version 8B62

update to ionic@latest this fix the issue thankyou!