react-native 运行ios程序remote js debugging出现跨域问题时怎么办

1. 问题

我们知道,调试rn程序时,使用remote js debugging,通过chrome查看日志,但是有时会出现cors错误,其实就是跨域问题。


cors错误截图

下面是报错的内容

Failed to load http://192.168.38.106.xip.io:8081/index.delta?platform=ios&dev=true&minify=false&deltaBundleId=2: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
  1. 解决方案
    出现这个问题是因为chrome没有安装cors插件,安装后再reload就行了。
    点击这里安装插件https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容