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.
Related
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.
I am doing a expo project and I'm using #ui-kitten and after starting running the project on my emulator I keep getting Unable to resolve module ./calendar/service/date.service from node_modules#ui-kitten\components\ui\index.js: but I am not using any calendar in my project too
I have deleted the node_modules and reinstalled it many times. I have also deleted the ui-kitten and reinstalled nut it still not working
I use react-native with actual version and have tried to create a simple project. But while trying to create it by using
expo init AwesomeProject
the whole process hangs.
I have tried to look for a solution by searching on the internet but without any luck.
The error could be seen in the following screenshot:
That error generally means that a file is being accessed by two different things at 'around' the same time. And 90% of those times it is because of an anti-virus or similar.
Its a permission error, so my advice, try to do it after a fresh reboot and boot the powershell as admin, disable antivirus etc..
If still does not work reinstall nodejs/npm.
I had the same experience. The project gets created using React-native. When you try to run it, the 'Metro' interface comes up. There is an android phone on the USB drive which has previously been used to run Android Studio created projects successfully. However, on the command shell the app hangs in Metro.
While trying to run the project from Android Studio snow cat, there are build errors (red) in the App manifest file and there is this exception.
Build failed due to java.lang.NullPointerException
Installed expo-cli (C:\Reactive-native>npm install -g expo-cli). The app fails to run and hangs on the connected Android phone(Samsung 21) using the Expo Go client. This client has no problem having been tested in Snackbar.
I have a question in the Expo forum and probably someone will answer!
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
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.