7

This one is a real head-scratcher. I've been using webpack-dev-server and localhost does not work on my computer, although it does on other people's computers, with the same setup.

I can access 127.0.0.1 on the same port (any open port is working the same), but not matter what I do localhost doesn't work.

I thought it was my webpack-dev-server config, but then I just tried gatsby which uses webpack-dev-server internally and had the same issue.

localhost for browsersync, docker, and node/express works fine. Here's my /etc/hosts file:

##
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost

I'm on macOS sierra 10.12.6. Fresh install of gatsby is not working. But also on my own build I'm on webpack-dev-server 2.11.1.

Any ideas?

Brian Jenkins
  • 349
  • 1
  • 6
  • 22
  • 2
    I still haven't figured this out myself. I am on macOS Sierra 10.13.3, webpack-dev-server 2.9.7 and it's doing the same for me (localhost - no, 127.0.0.1 works). What's really weird - this used to work, and if I change the port to something other than 8080, even localhost will work. – Lo-Tan Mar 27 '18 at 18:00
  • Interesting... No ports work for me unfortunately :( – Brian Jenkins Mar 30 '18 at 20:00
  • Same here on Mojave. This happens to me in Chrome. But opening in Private tab works, opening with FF or Opera works. Testing with `curl` also works. – Dimitry K Mar 31 '20 at 10:29

0 Answers0