Localhost:8100 not accessible after upgrade to Ionic CLI v3

Hello, guys!

Recently, I updated my Ionic (version 3) and Cordova (version 7).
But I can’t start a local dev server for app dev/testing with ionic serve command.
In my terminal, the serve started normally without errors.

Bellow some utils information about my Ionic project

$ ionic info:

global packages:

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

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-ionic-angular : 1.3.1
Ionic Framework                 : ionic-angular 3.4.2

System:

Node       : v7.4.0
OS         : macOS Sierra
Xcode      : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.1
ios-sim    : 5.0.13
npm        : 4.1.2

When I’m running $ ionic serve command the browser console log return:

This site can’t be reached
GET http://localhost:8100/ionic-lab net::ERR_CONNECTION_REFUSED

Any ideas?

What is the output of ionic serve --verbose?

@Sujan12, this is my output:

[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[INFO] Starting app-scripts server: --log-level debug --port 8100 --p 8100 --livereload-port 35729
–r 35729 --address 0.0.0.0 - Ctrl+C to cancel
[15:37:53] watch started …
[15:37:53] build dev started …
[15:37:53] clean started …
[15:37:53] clean finished in 3 ms
[15:37:53] copy started …
[15:37:53] transpile started …
[15:37:55] transpile finished in 1.66 s
[15:37:55] preprocess started …
[15:37:55] preprocess finished in less than 1 ms
[15:37:55] webpack started …
[15:37:55] copy finished in 1.77 s
[15:38:00] webpack finished in 4.96 s
[15:38:00] sass started …
[15:38:01] sass finished in 863 ms
[15:38:01] postprocess started …
[15:38:01] postprocess finished in less than 1 ms
[15:38:01] lint started …
[15:38:01] build dev finished in 7.52 s
[15:38:01] watch ready in 7.54 s
[15:38:01] dev server running: http://localhost:8100/

[INFO] Development server running
Local: http://localhost:8100

[15:38:02] lint finished in 1.30 s

And can you access this URL now?

If you really want to use lab, have a look at the params of ionic serve: https://ionicframework.com/docs/cli/serve/

@Sujan12, the server running but I can’t access that url.

http://localhost:8100/

That is indeed strange.

Is there a proxy configured in your browser?
Can you try 127.0.0.1:8100?

1 Like

Thank you so much @Sujan12

The problem is my /etc/hosts file.

I created a alias to 127.0.0.1:8080 and that makes Ionic serve got lost the address the way to find the default address.

Best regard.

2 Likes

Ah, makes sense. Did you route localhost to :8080 or what did you do?

@Sujan12, I just removed the alias for my hosts file.

The funny thing is that it was working in the last Ionic and Cordova version.
I don’t remember what’s the version I was using. Because I change version for many times.

That is it. :confused:

1 Like

im having the same problem, and im new to ionic, the server is running, i have tried ionic serve, ionic serve -l, ionic serve -w chrome/firefox and ionic cordova run browser still it doesn’t deploy the app on the browser

C:\Users\DEXTERSBRAIN\Desktop\FONTENDPROJECTS\IONIC\My_app>ionic serve -l
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
–lab - Ctrl+C to cancel
[14:35:57] watch started …
[14:35:57] build dev started …
[14:35:57] clean started …
[14:35:57] clean finished in 12 ms
[14:35:57] copy started …
[14:35:57] deeplinks started …
[14:35:57] deeplinks finished in 46 ms
[14:35:57] transpile started …
[14:36:04] transpile finished in 7.29 s
[14:36:04] preprocess started …
[14:36:04] preprocess finished in 3 ms
[14:36:04] webpack started …
[14:36:05] copy finished in 7.64 s
[14:36:16] webpack finished in 11.57 s
[14:36:16] sass started …
[14:36:18] sass finished in 1.96 s
[14:36:18] postprocess started …
[14:36:18] postprocess finished in 17 ms
[14:36:18] lint started …
[14:36:18] build dev finished in 21.07 s
[14:36:18] watch ready in 21.31 s
[14:36:18] dev server running: http://localhost:8100/

[OK] Development server running!
Local: http://localhost:8100
DevApp: My_app@8100 on DESKTOP-SSB3DIK

can you help if you got around this problem

Without getting too deep into the relationships between different parts of the solution. Here is what I did and it worked, I specified –address=127.0.0.1 attribute, and that did it.
C:\Home\Projects\evaluway>ionic serve --address=127.0.0.1

ng.cmd run app:serve --host=127.0.0.1 --port=8100