React-Native Fresh Install Compile Error - react-native

I've created a few react-native projects, and since updating to Sierra OSX and Xcode 8, upon opening each project, I get the error:
Application AppName has not been registered. This is either to due to a require() error during initialisation or a failure to call AppRegistry.registerComponent.
I've gone back to basics, uninstalled and reinstalled node, reinstalled latest react-native, created a fresh init, and still get the error. I've looked up and removed the custom-compiler-flags, as suggested here.
This is a real problem, if anyone has any insights I would be very appreciative!

I was having this error last night! All I did was to remove the node_modules, install then again and run the app again, it worked. – Crysfel

Related

React Native TypeError: Cannot read property 'indexOf' of undefined, js engine: hermes

I am working on a react-native project. I have been running the application on Android and iOS devices for the past 6 months. I haven't faced any problems till now. But suddenly today, while I am trying to run the application I am getting a compile error with the description. TypeError: Cannot read property 'indexOf' of undefined, js engine: hermes. I tried to debug the issue and found that there is an issue while connecting to the remote debugger. But the strange thing here is even I haven't selected the remote debugging option from either of emulator or simulator.
So, I have enabled the remote debugging option from the emulator to get a quick fix. It is working fine. But why is it connected to the remote debugger even after the fresh installation? And the quick fix comes with its own issues. The application is functioning a bit lag and inconsistent. I suspect there is an issue with the metro bundler. I have removed the cache using rm -rf /tmp/metro-* command, cleaned gradle using ./gradlew clean command, and cleaned iOS build by deleting derived Data. But still, the issue persists.
Is there any other step am I missing here? If it is the issue with the metro bundler, is there any way to reset it completely? Please check the attached image for more information.
The reason for this issue in my case is not with the metro bundler or its cache but with one of the third-party dependency named auth0-js(In your case it would be different). It is adding some global or window properties which are causing the above-mentioned issue. I have removed it and replaced with the library which is closed to react-native ecosystem which eventually resolved the issue.

react-native metro is path is missing in node_modules

Error is this
Error: Unable to resolve module metro/src/lib/bundle-modules/HMRClient
Here is additional error logs
This error appeared when I had to create a new project and ran react-native run-android just right after running react-native init PROJECT_NAME. Why I had to create another project is due to another error shown in this question.
Now I can't seem to run any of my react-native applications due to these problems. I am thinking this is a cache problem or somethings? maybe unstable package versions.
I have also found this solution in GitHub threads and actually removed the error log, but keeps crashing my application in android emulator (android studio)
I have tried reinstalling react-native-cli, but still have this error.

Unable to find module for EventDispatcher React Native

On starting application using react-native run-ios its showing error on simulator Unable to find module for EventDispatcher
Stop remote JS debugging and then reload the app
It will give you the appropriate error message, most likely missing some render on one of your components. That fixed it for me.
So this issue happened to me after I upgraded to RN 0.59.x.
I was getting this error when live reload was enabled or if i tried to refresh screen on iOS by pressing CMD+R.
Related issues:
Unable to find module for UIManager
Unable to find module for
DevLoadingView
Unable to find module for EventDispatcher
Here's how I solved it:
Edit your AppDelegate.m file and add the following code before the #end
#if RCT_DEV
- (BOOL)bridge:(RCTBridge *)bridge didNotFindModule:(NSString *)moduleName {
return YES;
}
#endif
This will fix the issue.
Link to the fix on github.
Related discussion on github.
Live reload and debug mode all should work without problems now.
This seems to be an issue when using the remote debugger with certain RN versions above 0.58. Using react-native-debugger should solve the issue as it supports RN versions above already.
It can be downloaded from the following link:
https://github.com/jhen0409/react-native-debugger/releases
I've started receiving this error after upgrading RN from v0.57.3 to v0.58.6.
Running packager with yarn start -reset-cache / react-native start --reset-cache fixed the issue for me.
What worked for me was simply stopping remote debugging as mentioned by #Hackman,
THEN killing the browser debugger, cleaning Xcode and rebuilding.
Couldn't tell you why, but the issue went away.
I'm using detox, what worked for me was switching the build command from
-configuration Debug
to
-configuration Release
It will no longer fetch from metro bundler and instead use the js bundle from the build. When I'm coding the tests, I build with debug since I'm fine with occasionally seeing the error, since I like the connivence of not having to constantly build and letting metro bundler do it for me.

Fabric - App could not be install error iOS

I have recently updated Fabric and I am getting an issue where users can no longer install the beta apps I send out. I keep getting the error saying - app could not be installed at this time. Has anyone encountered this issue since updating Fabric? Up until the update, I have had no issues sending out beta builds.
Edit: I just tried installing old version of app sent out with old fabric, it installed fine and works. I then get an alert saying there is a new version you can update to (the one I sen out recently), when it finishes installing that, it then shows error saying could not be installed again.
Edit 2 Confirmed it is an issue with updated Fabric. My have a git branch that was last updated on Monday, this was prior to the Fabric update. So I tested on that branch, archived app, sent out, can download just fine. I then updated Fabric, and sent out again, then I got the error message saying unable to download app.
Found the problem. It seems installing the new Fabric through the manual install process is the problem. I had installed Fabric following these instructions
https://fabric.io/kits/ios/crashlytics/manual-install
After trying multiple reinstalls without any success, I tried to install the new Fabric via Cocoapods and now it seems to work fine. Hope this helps anyone else having the same issue

"babelHelpers.interopRequireDefault is not a function" when upgrading to React Native 0.16.0-rc

I upgraded to react-native 0.16.0-rc, ran npm install, then ran react-native upgrade. When trying to launch the iOS app in a simulator (or device, doesn't matter) I get the error:
[error][tid:com.facebook.React.RCTExceptionsManagerQueue] Unhandled JS Exception: babelHelpers.interopRequireDefault is not a function. (In 'babelHelpers.interopRequireDefault(_reactNative)', 'babelHelpers.interopRequireDefault' is undefined)
I've just about run out of ideas here. Is there something I need to add to my xcode project maybe? Merging the latest react-native templates into mine was a nightmare so maybe something got messed up there.
This problem is discussed in this Github issue and fixed by this commit. You can apply this patch temporarily until it is merged into the project with the version 0.16.