I get this error when I upload my site to my webserver:
http://desktop-gq7oerj:3000/sockjs-node/info?t=1489850537555 net::ERR_CONNECTION_REFUSED
my webpack config is:
entry: [
'webpack-dev-server/client?http://' + require("os").hostname() + ':3000/',
'webpack/hot/only-dev-server',
'./src/index'
],
How can I fix it?
I get this error when I upload my site to my webserver:
http://desktop-gq7oerj:3000/sockjs-node/info?t=1489850537555 net::ERR_CONNECTION_REFUSED
my webpack config is:
entry: [
'webpack-dev-server/client?http://' + require("os").hostname() + ':3000/',
'webpack/hot/only-dev-server',
'./src/index'
],
How can I fix it?
Share Improve this question asked Mar 18, 2017 at 15:25 BomberBomber 11k27 gold badges97 silver badges175 bronze badges 4- Is your server listening on port 3000? – Matt Commented Apr 4, 2017 at 0:22
- Thanks for your reply. Is there a way I can find out? As the error is ing from my dev server, do I even need it running in production? – Bomber Commented May 16, 2017 at 15:08
- You say you're uploading it to your webserver? Webpack-dev-server is not for production use. What you should do is use webpack to build production code and upload those. You then setup a node/nginx server to serve the static files. – uLan Commented Aug 4, 2017 at 10:14
- If you use docker check my answer here stackoverflow./a/65523561/4248573 it may be related – Alexey Muravyov Commented Dec 31, 2020 at 16:59
2 Answers
Reset to default 1In my case,it worked this => Here's a link
in webpack.config i aggregated :
devServer: {
socket: 'socket',
...
},
Try this
entry: production
? './src/index'
: [
`webpack-dev-server/client?http://0.0.0.0:${SETTINGS.PORT}`,
'webpack/hot/only-dev-server',
'./src/index',
],