Skip to content

Commit

Permalink
change the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
vonovak committed Jul 11, 2020
1 parent 302f170 commit 8944a26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Libraries/BatchedBridge/MessageQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,8 @@ class MessageQueue {
const moduleMethods = this.getCallableModule(module);
invariant(
!!moduleMethods,
`Module ${module} is not a registered callable module (calling ${method}). This can happen when the application entry file path is incorrect.
On Android, verify 'getJSMainModuleName()' in 'MainApplication.java' and 'project.ext.react.entryFile' in 'android/app/build.gradle'.
On iOS, verify '- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge' in 'AppDelegate.m' and 'ENTRY_FILE' env. variable passed to 'react-native-xcode.sh' (if any) in 'Build Phases' -> 'Bundle React Native code and images'.
`,
`Module ${module} is not a registered callable module (calling ${method}). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.`,
);
invariant(
!!moduleMethods[method],
Expand Down
3 changes: 2 additions & 1 deletion Libraries/BatchedBridge/__tests__/MessageQueue-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ describe('MessageQueue', function() {
const unknownModule = 'UnknownModule',
unknownMethod = 'UnknownMethod';
expect(() => queue.__callFunction(unknownModule, unknownMethod)).toThrow(
`Module ${unknownModule} is not a registered callable module (calling ${unknownMethod}). This can happen when the application entry file path is incorrect.`,
`Module ${unknownModule} is not a registered callable module (calling ${unknownMethod}). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.`,
);
});

Expand Down

0 comments on commit 8944a26

Please sign in to comment.