admin管理员组文章数量:1356364
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',
],
本文标签: javascriptwebpack errorsockjsnode connection refusedStack Overflow
版权声明:本文标题:javascript - webpack error — sockjs-node connection refused - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744041237a2580702.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论