Ionic App not launching automatically in default browser

I am trying to run the command “ionic serve”.
It is launching an empty window of my default browser (chrome).
The app server started correctly but I need to enter app URL in browser manually.

Earlier it used to be launched perfectly.
Please help.

@RahulBhooteshwar I don’t think it’s an issue from the Ionic CLI, I think you may have a code error in your app.js when you are doing the routing. Check all your routing ($state configuration) and also your console error log to see if you have any error thrown somewhere.

I have already mentioned that app is working fine. The issue is just “It is not automatically launching in chrome.” when I run ionic serve command.

RahulBhooteshwar
I am trying to run the command “ionic serve”.
It is launching an empty window of my default browser (chrome).
The app server started correctly but I need to enter app URL in browser manually.

Earlier it used to be launched perfectly.
Please help.

Maybe I’m blind or I have some dyslexia but I don’t see where you are mentioning that you app is working fine …

@Devniz

Please don’t take it otherwise.
But the sentence “The app server started correctly but I need to enter app URL in browser manually” itself implies that the app is working fine but the issue is with automatic launching. The Subject of the topic also implies the same.

The app server started correctly but I need to enter app URL in browser manually

This mention to me that:

  • Your ionic server command is running without problem.
  • You are able to navigate through your app by entering the URL in your browser.

I’m sorry but It still doesn’t confirm that you’re app is working fine and moreover, inserting your URL just to display the view doesn’t mean that you’re app is working, it may throw an error somewhere. Are you able to navigate by using your $state configuration in your app.js, if you click on a button for example?

What does the browser load? Does it open a tab with nothing? No tab at all?

@Sujan12
It opens a tab with nothing (not even any URL in address bar).

@Devniz
Yes I can navigate to all the routes in my app with no errors on CLI & browser console. :smile:

Which version of Ionic CLI are you using right now?
Which version of your browser are you using?

I looked at the code of ionic serve a bit but to be honest couldn’t figure out how it decides which browser to use and how it actually opens it from the console: https://github.com/driftyco/ionic-app-lib/blob/master/lib/serve.js#L216