Skip to content

Commit 26168d0

Browse files
terriblebenfacebook-github-bot
authored andcommitted
Add more information to __fbBatchedBridge is undefined error
Summary: **Motivation:** This error can be a symptom of various other issues (see: an issue search for `__fbBatchedBridge is undefined`). I'm hoping to provide slightly more information about what might be going wrong and how to self-help. **Test Plan:** Run some JS before the bridge has injected itself into the JS context. (sort of copping out here since the change is just to an error string literal.) Closes #15184 Differential Revision: D5499445 Pulled By: javache fbshipit-source-id: 8051869feb5fe5fc630516972775c134f6e41a04
1 parent d188375 commit 26168d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

React/Executors/RCTJSCExecutor.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,11 @@ - (void)_executeJSCall:(NSString *)method
596596
}
597597
} else {
598598
if (!errorJSRef && JSC_JSValueGetType(ctx, batchedBridgeRef) == kJSTypeUndefined) {
599-
error = RCTErrorWithMessage(@"Unable to execute JS call: __fbBatchedBridge is undefined");
599+
error = RCTErrorWithMessage(@"Unable to execute JS call: __fbBatchedBridge is undefined. This can happen "
600+
"if you try to execute JS and the bridge has not set up, for example if it encountered "
601+
"an incomplete bundle or a fatal script execution error during startup. Verify that a "
602+
"valid JS bundle is included with your app and that it loaded correctly, or try "
603+
"reinstalling the app.");
600604
}
601605
}
602606

0 commit comments

Comments
 (0)