VUE中的错误:与ws:// ...加载时中断了与WS:// ...
与ws://192.168.1.36:8080/ws的连接中断了页面加载时,
我每秒都会弹出此错误。它要么在我运行“ NPM审核修复”或尝试安装socket.io-client之后开始。有趣的是,这仅发生在Firefox中。我没有任何插座代码,这显然与热重加载有关。构建项目后,它通常没有错误。我谷歌搜索了很多,但没有找到解决这个问题的方法。提前致谢。
The connection to ws://192.168.1.36:8080/ws was interrupted while the page was loading
I have this error popping up every second. It started either after I ran "npm audit fix" or after I tried to install socket.io-client. Interestingly, this only happens in Firefox. I don't have any socket code, this is clearly related to hot reload. After I build the project, it works normally without errors. I googled a lot but haven't found a way to solve this. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有同样的问题。就我而言,这是由开发服务器代理引起的。
我的应用程序是在vue.config中使用webpack和devserver属性,以将API调用从Frontend重定向到我的Localhost后端。
升级到VUE 2.7后,Firefox开始用WS进行垃圾邮件垃圾邮件控制台。
当我查看靠背的控制台时,我看到了很多要求 /WS端点的请求。
解决方案是将配置从后端更改
为
未收到 /WS的请求,而Firefox停止抱怨失败。
我不知道为什么Chrome没有这个问题。
I had same problem. In my case it was caused by dev server proxy.
My application was using webpack and devServer property in vue.config to redirect api calls from frontend to my localhost backend.
After upgrade to vue 2.7 firefox started spamming console with ws interrputed.
When I look at the console of my backed I saw a lot of request to /ws endpoint.
The solution was to change configuration from
to
After that backend was not receiving request for /ws and firefox stopped complaining about failures.
I have no idea why chrome didn't have that issue.