Webpack-dev-server: No data received ERR_EMPTY_RESPONSE

Created on 23 May 2015  Â·  26Comments  Â·  Source: webpack/webpack-dev-server

I followed http://webpack.github.io/docs/tutorials/getting-started/ exactly, and the last step

webpack-dev-server --progress --colors results in this error

image

I've tried

Most helpful comment

This might help some of you. I was experiencing the same issue running a vagrant VM with port forwarding on port 3000. I could curl http://localhost:3000 from within the VM but content wasn't getting forwarded. By default, webpack-dev-server binds to localhost (127.0.0.1) which is a loopback address. Therefore you need to add --host 0.0.0.0 to your webpack-dev-server command. Mine:

webpack-dev-server --hot --progress --colors --host 0.0.0.0 --port 3000

No other changes were necessary.

@fredantell provides a similar solution above.

All 26 comments

Did you ever figure this out? I have the exact same problem...in the console I'm seeing this:

GET http://localhost:3002/socket.io/?EIO=3&transport=polling&t=1438181843342-11 net::ERR_EMPTY_RESPONSE

I'm using vagrant with a private network. I'm not sure if that has anything to do with it.

I can't remember what I did to fix it. I think I wiped everything and started from scratch... I vaguely remember thinking it was a user (my) error though.

@aesopwolf Thanks, think I'll start again :+1:

@alextiley If you solve this, would love to hear what you did. We're currently running into this right now. Works on 3 machines, fails on 1. I'll post back if we figure it out.

@aesopwolf, I am running into the exact same issue and I have tried to run everything from scratch as well. Did you figure out what exactly was leading to the issue? It will help me tremendously if you know the answer. Thanks!

To follow up, I'm not sure that we really solved the problem, but we did work around it. On the machine that was having issues, accessing the server from http://127.0.0.1:8080/ worked where http://localhost:8080/ failed. This is despite the /etc/hosts file appearing to be correct, and despite the fact that a python SimpleHTTPServer was accessible via http://localhost:8080/ with no issues.

In addition to that workaround, we also dropped our repo into a docker container. In order to make that function properly we added a "-host 0.0.0.0" flag to the command to launch the server. In the end it became:
"webpack-dev-server --hot --host 0.0.0.0 --progress --colors"
and our webpack.config.js had this entry:
entry: {
app: [
"webpack-dev-server/client?:8080/", //fix issues with socket.io and live reloading
'webpack/hot/dev-server',
.......
]
}

I've got the same issue. Also in the console webpack doesn't output the stats anymore …

Did anyone ever figure out how to resolve this? I'm experiencing the exact same behaviour as @fredantell. Localhost host works fine for everything but webpack-dev-server.

Try using 127.0.0.1 or another alias from /etc/hosts. You'll need to use a matching --host parameter when you start webpack-dev-server and may need to update output.publicPath in your config as well.

Here's how I did it.

in /etc/hosts:
127.0.0.1 cheetah

in webpack.config.js:
output.publicPath = 'http://cheetah:8080/';

command line:
webpack-dev-server --host cheetah

** PS ** this was simplified from my actual configuration.

guess you should check if there's some proxy extension on your chrome XD

or shadow sock something

This might help some of you. I was experiencing the same issue running a vagrant VM with port forwarding on port 3000. I could curl http://localhost:3000 from within the VM but content wasn't getting forwarded. By default, webpack-dev-server binds to localhost (127.0.0.1) which is a loopback address. Therefore you need to add --host 0.0.0.0 to your webpack-dev-server command. Mine:

webpack-dev-server --hot --progress --colors --host 0.0.0.0 --port 3000

No other changes were necessary.

@fredantell provides a similar solution above.

I had to use 127.0.0.1

@jbschrades Thank you so much for the solution. It worked for me!

I was able to solve this issue by doing this as well:

webpack-dev-server --port 3000

webpack-dev-server --inline --hot --progress --colors --host 0.0.0.0 --port 4000

problem: localhost:8080 failed but 127.0.0.1:8080 worked
i resolved this problem by delete the line '::1 localhost' in the /etc/hosts

I was able to delete '::1 localhost' in /etc/hosts and it works now

Closing because these issues do seem to fix themselves, and we can't do nothing about it here in webpack-dev-server. Feel free to comment though.

I had this problem; turns out I had an errant Docker container running in the background from another project listening on the same port (no http errors shown in webpack-dev-server though - watch out!). Stopped the containers, then everything worked @ localhost:8080

https://github.com/aepsilon/turing-machine-viz/issues/1 someone can help me please i want install this project

@ito2307 please try using Stack Overflow for support questions. the issues here are debugging and improving the project itself.

Maybe you could try it that turn "Global Mode" to "Auto Proxy Mode" in ShadowsocksX.

Ran a docker prune and re-built my images. Fixed. Probably could have restart the docker engine???

You can also change the port directly in the webpack.config.js file:

devServer: {
      port: 8000
  }

In my case it was caused by my VPN

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikirossi picture nikirossi  Â·  3Comments

gimmi picture gimmi  Â·  3Comments

wojtekmaj picture wojtekmaj  Â·  3Comments

MJ111 picture MJ111  Â·  3Comments

hnqlvs picture hnqlvs  Â·  3Comments