react-native-threads icon indicating copy to clipboard operation
react-native-threads copied to clipboard

Using main bundle instead of thread bundle in iOS release mode (react-native 0.68.1)

Open therealgilles opened this issue 2 years ago • 2 comments

I believe this change broke using the correct thread bundle in iOS release mode with react-native 0.68.1, and instead using the main bundle:

THREAD NAME App/Workers/my_worker  // <-- correct path
starting Thread: file:///Users/.../Library/Developer/CoreSimulator/Devices/.../my-app.app/main.jsbundle // <-- wrong bundle

Anyone has a suggestion for a fix?

therealgilles avatar Apr 19 '22 18:04 therealgilles

Here is a possible fix in ThreadManager.m but probably not the best one:

//NSURL *threadURL = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:name fallbackResource:name];
  NSURL *threadURL = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:name fallbackURLProvider:^NSURL * {
          return [[NSBundle mainBundle] URLForResource:name withExtension:@"jsbundle"];
      }];

therealgilles avatar Apr 19 '22 20:04 therealgilles

Can confirm this fixes things for RN 68. I had tried another suggestion of simply removing the fallbackResource param, but that used the wrong bundle for the thread.

RustyTheBoyRobot avatar Oct 26 '22 20:10 RustyTheBoyRobot