Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Live reload is not working with Ionic serve command

As per the Ionic Guide Chapter 4 http://ionicframework.com/docs/guide/testing.html, ionic serve will start a live reload server, which it does in my case, but reload is not happening.

Is there any pre-req we need to have for this thing to work? Like say live reload chrome extension?

E:\Ionic\myapp>ionic serve
Running dev server: http://localhost:8100
Running live reload server: http://localhost:35729
like image 396
Kunal Kapadia Avatar asked Aug 19 '14 20:08

Kunal Kapadia


People also ask

Does ionic support hot reload?

Remember ionic serve ? That was Live Reload working in the browser, allowing us to iterate quickly. We can also use it when developing on iOS and Android devices.

How do you refresh an ionic page?

In this HTML file, we need to add <ion-refresher> component where we call the Refresh event. Inside this component, add the <ion-refresher-content> sub-component which contains the custom refresher properties.

How do I run an ionic app on localhost?

By default, ionic serve boots up a development server on localhost . To serve to your LAN, specify the --external option, which will use all network interfaces and print the external address(es) on which your app is being served. Try the --lab option to see multiple platforms at once. ionic serve uses the Angular CLI.

How do you restart the ionic app?

Press and hold all three buttons on the Ionic until you see the Fitbit logo.


2 Answers

Here is what worked for me:

  • stop ionic service if you running it 'q' command
  • run: ionic address from command prompt

After running this command it will prompt you to select what address you would like to use one is localhost and the second one is your machine IP address. Try to use select your machine IP address instead of localhost.

like image 111
Vlad Bezden Avatar answered Nov 11 '22 10:11

Vlad Bezden


Even I faced similar issue, console used to display the file changed but automatic browser refresh wasn't happening. Later I found out a missing closing tag in my index.html page that prevented ionic to inject the below script required for live reload.

    <script src="//localhost:35729/livereload.js?snipver=1"></script>

Please check for any typo errors or other html issues in the index.html page and fix those. Live reload should word properly after that.

like image 40
Swaminathan Vetri Avatar answered Nov 11 '22 09:11

Swaminathan Vetri