diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm index de522b07d03..c96725c0464 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm @@ -535,6 +535,9 @@ - (void)handleBundleLoadingError:(NSError *)error - (void)_loadJSBundle:(NSURL *)sourceURL { + // Initialize DevSettings before the request so Metro can reload after an initial bundle failure. + [_turboModuleManager moduleForName:"DevSettings"]; + #if RCT_DEV_MENU && __has_include() { id loadingView = @@ -567,7 +570,6 @@ - (void)_loadJSBundle:(NSURL *)sourceURL [strongSelf handleBundleLoadingError:error]; return; } - // DevSettings module is needed by _loadScriptFromSource's callback so prior initialization is required RCTDevSettings *const devSettings = (RCTDevSettings *)[strongSelf->_turboModuleManager moduleForName:"DevSettings"]; [strongSelf _loadScriptFromSource:source];