Log info when TurboModule cannot be found

Summary:
There are a surprisingly large number of nil modules in both bridge and bridgeless. So far, features may silently fail if a module is nil.

We can't log with with console.error or console.warn because many tests will break even though modules aren't used in the test.

Differential Revision: D27285601

fbshipit-source-id: 1467100f2a4c48e97de5dd6e846c26981c14f099
This commit is contained in:
Paige Sun
2021-03-25 16:08:38 -07:00
committed by Facebook GitHub Bot
parent fda1acec51
commit bfe3cd01bc
@@ -26,6 +26,10 @@ function requireModule<T: TurboModule>(name: string): ?T {
if (turboModuleProxy != null) {
const module: ?T = turboModuleProxy(name);
if (module == null) {
// Common fixes: Verify the TurboModule is registered in the native binary, and adopts the code generated type-safe Spec base class.
console.info('Unable to get iOS TurboModule for ' + name + '.');
}
return module;
}