diff --git a/Libraries/Utilities/MessageQueue.js b/Libraries/Utilities/MessageQueue.js index 2e542b6c40..e9df21105f 100644 --- a/Libraries/Utilities/MessageQueue.js +++ b/Libraries/Utilities/MessageQueue.js @@ -192,10 +192,17 @@ class MessageQueue { let debug = this._debugInfo[cbID >> 1]; let module = debug && this._remoteModuleTable[debug[0]]; let method = debug && this._remoteMethodTable[debug[0]][debug[1]]; - invariant( - callback, - `Callback with id ${cbID}: ${module}.${method}() not found` - ); + if (!callback) { + let errorMessage = `Callback with id ${cbID}: ${module}.${method}() not found`; + if (method) { + errorMessage = `The callback ${method}() exists in module ${module}, ` + + `but only one callback may be registered to a function in a native module.`; + } + invariant( + callback, + errorMessage + ); + } let profileName = debug ? '' : cbID; if (callback && SPY_MODE && __DEV__) { console.log('N->JS : ' + profileName + '(' + JSON.stringify(args) + ')');