React native 连接到chrome调试器时无法运行CodePush脱机捆绑包。将React Native与iOS一起使用

React native 连接到chrome调试器时无法运行CodePush脱机捆绑包。将React Native与iOS一起使用,react-native,code-push,React Native,Code Push,我将CodePush与React Native和iOS一起使用。当使用CodePush连接到chrome调试器时,在使用CodePush脱机捆绑包时,我遇到以下错误: Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'file:///Users/naderdabit1/Library/Developer/CoreSimulator/Devices/11

我将CodePush与React Native和iOS一起使用。当使用CodePush连接到chrome调试器时,在使用CodePush脱机捆绑包时,我遇到以下错误:

Uncaught NetworkError: 
Failed to execute 'importScripts' on 'WorkerGlobalScope': 
The script at 'file:///Users/naderdabit1/Library/Developer/CoreSimulator/Devices/115F136F-…ation/B0ECCD9D-8274-4308-A9C7-BAA2746FDF02/StudentStatus.app/main.jsbundle' 
failed to load.

当我切换到本地包或禁用chrome调试器时,错误就会消失


有什么想法吗?谢谢。

AppDelegate.m
文件中将JS捆绑包位置设置为
[NSBundle mainBundle]URLForResource:@“main”带扩展名:@“jsbundle”]
然后启用
Chrome调试时,您能确认没有看到同样的错误吗?据我所知,您只能在应用程序从packager加载JS捆绑包时启用Chrome调试,因为使用
[CodePush bundleURL]
是从磁盘加载JS捆绑包(二进制文件中包含的捆绑包或最新的CodePush更新),它自然不支持Chrome调试场景

我们已经做了一些工作,以确保CodePush插件将与packager协同工作,这样开发人员就可以使用他们的自然调试工作流(例如livereload、Chrome支持),而无需更改任何内容来支持测试/与CodePush共存。我们的文档目前建议在iOS上使用以下解决方案,我很想知道是否有我们缺少并可以改进的方案:

NSURL *jsCodeLocation;

#ifdef DEBUG
    jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
#else
    jsCodeLocation = [CodePush bundleURL];
#endif

我现在不在工作电脑旁,但我明天第一件事就是检查一下。谢谢你的详尽回答!谢谢,我正在使用脱机捆绑包。