Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic live reload feature not reloading application

I tried to use live reload feature with ionic serve and ionic emulate ios --livereload. Server starts well, application is displayed on simulator (or in browser) and it works smoothly.

When I change a file (a js or html in www directory) and save it, console write HTML changed: www/index.html for example, but application doesn't reload itself as it should be.

I supposed that websocket between server and app could be broken, but when I kill the server (Ctrl-C), web inspector immediatly fire the following error : [Error] WebSocket network error: The operation couldn’t be completed. Connection refused (192.168.5.2, line 0, x4)

So I supposed that there is no issue with websocket. Moreover, it is displayed with no error in Network pane of web inspector.

Is there something I missed to made livereload work ?

My configuration :

  • Cordova CLI: 5.0.0
  • Ionic Version: 1.0.0
  • Ionic CLI Version: 1.4.5
  • Ionic App Lib Version: 0.0.22
  • ios-deploy version: 1.7.0
  • ios-sim version: 3.1.1
  • OS: Mac OS X Yosemite
  • Node Version: v0.10.30
  • Xcode version: Xcode 6.3.2 Build version 6D2105

Don't hesitate to ask me for clarification if something is not clear.

Edit

I also tested it without Internet connection at all to check if it was a firewall issue or something like that, but it changes nothing.

like image 297
Blackus Avatar asked Nov 10 '22 12:11

Blackus


1 Answers

Try running ionic address and selecting the correct interface.

If it doesn't work and it's iOS 9, it may be an issue with Apple ATS:

https://github.com/driftyco/ionic-cli/issues/605

It could also be a CORS issue. In this case, try installing the cordova-white-list plugin.

like image 128
Rafael Jannone Avatar answered Nov 29 '22 06:11

Rafael Jannone