For what it’s worth, I had exactly this issue and it had me stumped for 2 days. My mistake was creating and renaming some files — stupidly, whilst my project was still running. This inadvertently messed up some of my paths/imports. I wasn’t seeing any issues in VS Code however every time I ran the project it would work first time after a full clean and then when I refreshed I’d get this error:
ERROR TypeError: undefined is not a function, js engine: hermes
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication).
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). 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., js engine: hermes
I only knew this was the issue because I got my colleague to sync the project using my branch and test it on his Mac and it worked fine. The solution might be to try cleaning Android, iOS and Watchman first and if that doesn’t work I would suggest try deleting the project folder from your machine and re-clone the repo and run it again.
Useful clean scripts to try:
For Android:
watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules && rm -rf yarn.lock && yarn cache clean && yarn && cd android && ./gradlew cleanBuildCache && cd ..
For iOS:
watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf ~/Library/Developer/Xcode/DerivedData && rm -rf node_modules && rm -rf yarn.lock && rm -rf ios/build && yarn cache clean && yarn && cd ios && pod install --repo-update && cd ..