美文网首页
react-native 运行ios程序remote js de

react-native 运行ios程序remote js de

作者: 萤火虫叔叔 | 来源:发表于2018-04-27 15:36 被阅读536次

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

欢迎加我微信,拉进群交流哦!


微信二维码

相关文章

网友评论

      本文标题:react-native 运行ios程序remote js de

      本文链接:https://www.haomeiwen.com/subject/lgoblftx.html