Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection to localhost does not work due to IPv6 #4649

Closed
Timmmm opened this issue Oct 4, 2019 · 1 comment
Closed

Connection to localhost does not work due to IPv6 #4649

Timmmm opened this issue Oct 4, 2019 · 1 comment

Comments

@Timmmm
Copy link

Timmmm commented Oct 4, 2019

Version

3.11.0

Environment info

Mac 10.14.4

Steps to reproduce

  1. Create a new vue app using vue create. I've selected Typescript and Babel.
  2. Run it using npx vue-cli-service serve
  3. Try to connect to http://localhost:8080/

What is expected?

It connects.

What is actually happening?

It does not connect.


So this is some weird issue to do with IPv6. On my Mac, localhost resolves to ::1, not 127.0.0.1. With the steps above however, Node is told to listen on 127.0.0.1. That means when I connect to http://localhost:8080/ it doesn't connect.

If I run npx vue-cli-service serve --host ::1 then I can connect to http://localhost:8080/, but now http://127.0.0.1:8080/ does not connect.

"What's the problem?" you might think. "Just use 127.0.0.1 then". Well it is a problem because:

a) vue-cli-service (and maybe webpackdevserver) do all sorts of misguided shenanigans to try and make the URL more "friendly" or something. Honestly I'm not sure what they're trying to do.

b) I'm using electron-builder, which is awesome, but in dev mode it tries to load process.env.WEBPACK_DEV_SERVER_URL, which is set to http://localhost:8080/, which of course doesn't work because it isn't listening on localhost - it's listening on 127.0.0.1.

I think this may be purely a webpack-dev-server problem actually but I'm not 100% sure and I've written all this now...

@Timmmm
Copy link
Author

Timmmm commented Oct 8, 2019

Ugh never mind it was shitty ESET antivirus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant