-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve "not a registered callable module" error message #28913
Conversation
Base commit: 46d6e7f |
Base commit: 46d6e7f |
hello, @fkgozali I heard you might be the right person to review, would you mind taking a look at this? Thank you in advance! :) |
method, | ||
`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'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message for Android/iOS here assumes specific usage of a build system, which is not always the case (e.g. some uses BUCK to build). I'd just remove them, or provide url to a section in the https://reactnative.dev/ with platform specific instructions.
This can happen when the application entry file path is incorrect.
Note that this is not the only reasons this error happens, some times a bad JS bundle, or an early initialization error when loading React Native will cause this error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fkgozali I updated the message, please let me know if this is ok or not. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fkgozali hello again, would you please share your thoughts on this? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, I'm merging this.
590987f
to
8944a26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fkgozali has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was successfully merged by @vonovak in e27d656. When will my fix make it into a release? | Upcoming Releases |
) Summary: Motivation: `Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication).` is an error that happens rarely, and most SO answers end up recommending to use `react-native bundle` to work around. I stumbled upon this error the other day and it took me a while to figure out that the error was caused by the fact that my `entryFile` path was pointing to an existing but invalid file. I figured it would be nice to mention this because I believe this will be a frequent cause of the error. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Changed] - improve "not a registered callable module error message" Pull Request resolved: facebook#28913 Test Plan: tested locally with RNTester, prints ``` [Sun May 17 2020 18:15:55.396] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). 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'. ``` in metro logs Reviewed By: mdvacca Differential Revision: D23107228 Pulled By: fkgozali fbshipit-source-id: 0712ed7e593ba96b041578bafdbefcd09a3994b7
Summary
Motivation:
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication).
is an error that happens rarely, and most SO answers end up recommending to usereact-native bundle
to work around. I stumbled upon this error the other day and it took me a while to figure out that the error was caused by the fact that myentryFile
path was pointing to an existing but invalid file. I figured it would be nice to mention this because I believe this will be a frequent cause of the error.Changelog
[General] [Changed] - improve "not a registered callable module error message"
Test Plan
tested locally with RNTester, prints
in metro logs