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


    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 —— 虚拟器使用的端口

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

  • 相关阅读:
    常用加密解密类(含3des)
    谷歌API(Ajax)
    flashpaper使用详解
    布置小窝
    CodeSimth数据访问层模板
    CodeSmith业务逻辑层模板
    CodeSimth生成实体类模板
    C# 参考之方法参数关键字:params、ref及out
    ALV 格式常用参数
    BOM输出
  • 原文地址:https://www.cnblogs.com/q1104460935/p/12939333.html
Copyright © 2020-2023  润新知