Skip to content

Commit bfe3cd0

Browse files
p-sunfacebook-github-bot
authored andcommitted
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
1 parent fda1ace commit bfe3cd0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Libraries/TurboModule/TurboModuleRegistry.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ function requireModule<T: TurboModule>(name: string): ?T {
2626

2727
if (turboModuleProxy != null) {
2828
const module: ?T = turboModuleProxy(name);
29+
if (module == null) {
30+
// Common fixes: Verify the TurboModule is registered in the native binary, and adopts the code generated type-safe Spec base class.
31+
console.info('Unable to get iOS TurboModule for ' + name + '.');
32+
}
2933
return module;
3034
}
3135

0 commit comments

Comments
 (0)