diff --git a/Libraries/BatchedBridge/MessageQueue.js b/Libraries/BatchedBridge/MessageQueue.js index c1314d9ea794d0..fa2147b540d299 100644 --- a/Libraries/BatchedBridge/MessageQueue.js +++ b/Libraries/BatchedBridge/MessageQueue.js @@ -404,15 +404,12 @@ class MessageQueue { const moduleMethods = this.getCallableModule(module); invariant( !!moduleMethods, - 'Module %s is not a registered callable module (calling %s)', - module, - method, + `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], - 'Method %s does not exist on module %s', - method, - module, + `Method ${method} does not exist on module ${module}`, ); moduleMethods[method].apply(moduleMethods, args); Systrace.endEvent(); diff --git a/Libraries/BatchedBridge/__tests__/MessageQueue-test.js b/Libraries/BatchedBridge/__tests__/MessageQueue-test.js index fb720c7b9ba991..e1b7fd84d32411 100644 --- a/Libraries/BatchedBridge/__tests__/MessageQueue-test.js +++ b/Libraries/BatchedBridge/__tests__/MessageQueue-test.js @@ -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})`, + `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.`, ); });