首页 > Web开发 > 详细

使用 Expo 的错误 WebSocket connection to 'ws://localhost:19002/debugger-proxy?role=debugger&name=Chrome' failed: Error during WebSocket handshake: Unexpected response code: 400

时间:2020-05-22 20:37:04      阅读:94      评论:0      收藏:0      [点我收藏+]

Expo 调试

前提是在使用以下环境

名称 版本 icon
React native debugger V0.10 技术分享图片
React devTools latest 技术分享图片
Expo ~37.0.3 => 37.0.8 技术分享图片

错误:


WebSocket connection to ‘ws://localhost:19002/debugger-proxy?role=debugger&name=Chrome‘ failed: Error during WebSocket handshake: Unexpected response code: 400

接照本次的错误,是因为React native debugger无法成功访问ws://localhost:19002。

而很多开发将它定义为 WebSocket 的问题或是代理的问题。

答案连接了错误的端口导致。(但是如果并非这个问题,解决方案建议 expo diagnostics 诊断环境并重新安装来测试错误的重现。 )

下面我简单的描述端口的使用。

首先,运行 yarn start :

技术分享图片

  • Metro Bundler on port 19001 —— 绑定React native debugger 的端口

  • Expo DevTools is running at http://localhost:19002 —— 浏览器 可视化DevTools

  • exp://127.0.0.1:19000 in iOS simulator —— 虚拟器使用的端口

有些问题可能很小,但它就是欺负末懂者,它会纠缠很久。

使用 Expo 的错误 WebSocket connection to 'ws://localhost:19002/debugger-proxy?role=debugger&name=Chrome' failed: Error during WebSocket handshake: Unexpected response code: 400

原文:https://www.cnblogs.com/q1104460935/p/12939333.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!