Ionic Serve error - "This site can't be reached." (v2)

@sveinla No errors, and the same problem.

Can I bump this up? I’ve not exactly been able to accomplish anything because of this. I’ve tried every means I could think of, really. I need to find this out.

Is there anything else that I need to provide? I’m really starting to get worried at this point.

Hi I have tried following all your steps and the project works as expected.

Just checking you are running ionic serve from within the MyApp folder, correct?
try running ‘npm cache clean && npm install’ to see if a dependency didn’t pull down correctly.

Hope its something simple.

@MagicAardvark Ah! Thanks for that, I got this when I ran npm cache clean && npm install:

npm WARN angular2@2.0.0-beta.15 requires a peer of reflect-metadata@0.1.2 but none was installed.
npm WARN angular2@2.0.0-beta.15 requires a peer of zone.js@^0.6.10 but none was installed.
npm WARN myapp@ No repository field.
npm WARN myapp@ No license field.

So then I did: (in the MyApp directory, of course) npm i --save reflect-metadata@0.1.2 zone.js and then I ran ionic serve --lab and …

it doesn’t work. :disappointed:

Which version of ionic are you using? there were numerous changes in Angular around ngZone.

If you are on >beta.3 try following this guide

As you can see from my ionic info results:

Your system information:

Cordova CLI: 6.1.1
Gulp version: CLI version 1.2.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.6 # Latest version
Ionic CLI Version: 2.0.0-beta.25 # Latest version
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v5.11.1
Xcode version: Xcode 7.3.1 Build version 7D1014

So there’s a lot here, and it may just easier to go through things one more time.

So

npm i -g ionic@beta

ionic start myApp --v2 --ts
cd myApp
ionic serve --lab

This gives you errors?

@mhartington Slightly different.

 npm i -g ionic@beta
 ionic start MyApp **tutorial** --v2 --ts
 cd MyApp
 ionic serve --lab # even without --lab

Give me a second to verify without a starter.

Yes, even without a starter gives me an error (on the browser side - “This site can’t be reached”)

@mhartington By the way, seeing as this forum is not the ideal place to discuss things because of the time limit on replies, I had opened an issue on driftyco/ionic-cli of the same name: https://github.com/driftyco/ionic-cli/issues/998

1 Like

@mhartington Ok, this is very odd. Just for testing, I added the “MyApp” directory to Ionic Lab, and I used the serve thing. It worked! I always assumed that they used the command line under the hood. Apparently not, I think. With this new info, what do you think the problem could be (I prefer to remain in the command line, so I need to fix that)

@eshansingh are you cd’ing into the directory after creating the project?

Yes. I know my way around, really. There’s definitely something more to this. Also why does the forum limit the amount of time between a post and a reply? It seems odd.

It shouldn’t, but it may be to prevent any spam.

Alright… :thinking:

hmm, let move this to the github issue then. As i’m not sure what could be going on, and it would help to get the CLI folks thoughts on this.

Yes I have it here https://github.com/driftyco/ionic-cli/issues/998 however it had not recived enough attention so I posted it here.

Did you ask them? The GitHub issue has nothing. I apologize for bothering you so much… just wanted to know.

OK, so all of a sudden this is working in Firefox. Chrome and Safari still don’t work. Looks like it’s some problem with WebKit, or something … but why didn’t it work in Firefox earlier. Absolutely nothing changed from one day to the next! Why would it be so erratic?

In addition, other projects that I have that start up localhost servers, work (I have an Angular 1 project that uses gulp). So it can’t be an issue about Chrome either. It’s very odd. And Ionic v1 projects created using Ionic 2 CLI also have this problem.

If I use ionic address and change the address to my external IP address, ionic serve works in all browsers. Interestingly, when it was serving on localhost, localhost:8100/ionic-lab didn’t work, but 127.0.0.1:8100/ionic-lab worked. Looks like an issue of ionic serve listening in on the wrong port. Ordinarily localhost does get binded to 127.0.0.1 though, so I’m not sure exactly what’s happening (I should probably study up on networking!)