From 80f92adf1f35e74ee6db0b2f445cc851463059cf Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Fri, 9 Nov 2018 11:37:02 -0800 Subject: [PATCH] iOS: ignore double registration of lazy modules with chrome attached Summary: Depending on when Chrome debugger is attached, modules may get double registered. Simply ignore it for this case. The redbox was not a fatal error, which can be dismissed. Reviewed By: shergin Differential Revision: D12996107 fbshipit-source-id: 292f63102337077848842ca46b3daed08b1cae12 --- React/CxxBridge/RCTCxxBridge.mm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index f80e59e25a4627..4d7717d8dca022 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -666,10 +666,8 @@ - (void)registerExtraLazyModules // The new module returned nil from init, so use the old module continue; } else if ([moduleData.moduleClass new] != nil) { - // Both modules were non-nil, so it's unclear which should take precedence - RCTLogError(@"Attempted to register RCTBridgeModule class %@ for the " - "name '%@', but name was already registered by class %@", - moduleClass, moduleName, moduleData.moduleClass); + // Use existing module since it was already loaded but not yet instantiated. + continue; } }