TypeError: Cannot read property 'NativeModule' of undefined, js engine: hermes
Im using the latest versions of react native and the tfjs package. But when ai try to import bundleIOResources specifically. I get the error TypeError: Cannot read property 'NativeModule' of undefined, js engine: hermes
My project does not use expo, it is not an expo managed app
Taking a look at the code (I worked on it before), it seems to require some other libraries like expo-asset to work: https://github.com/tensorflow/tfjs/blob/master/tfjs-react-native/src/bundle_resource_io.ts
If you are not using expo, you might not have those libraries then it won't work. I think if you install expo-asset manually it should work.
You can also take what you need from tfjs-react-native/src/platform_react_native.ts into your own repo and then add whatever storage you need manually:
- async storage https://github.com/tensorflow/tfjs/blob/master/tfjs-react-native/src/async_storage_io.ts
- bundle resource https://github.com/tensorflow/tfjs/blob/master/tfjs-react-native/src/bundle_resource_io.ts
- mmkv https://github.com/ai-simulator/tfjs-react-native-mmkv-storage (written by me)
Hi, @Leli1024
I apologize for the delay in my response. Have you had a chance to try the workaround mentioned by @paradite in the previous comment? If so, please let me know if the issue has been resolved or if you are still encountering problems.
Thank you for your cooperation and patience.
Thanks both, I tried the workaround on my bare project and it did not work, but when I coded a dummy app using expo, it did so I'm assuming it is not working because these dependencies just don't work with react native bare projects.
Another thing to note is that when trying to run predictions on images, the app crashes
i am facing ERROR in react native project and I am unable to solve to these errors anyone can share the solution of these errors
TypeError: Cannot read property 'NativeModule' of undefined, js engine: hermes
LOG Running "AwesomeProject" with {"rootTag":171}
ERROR Invariant Violation: "AwesomeProject" has not been registered. This can happen if:
- Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
- A module failed to load due to an error and
AppRegistry.registerComponentwasn't called., js engine: hermes
J'ai exactement le même problème, si on peut m'aider (nous aider), c'est génial. As-tu corrigé le problème ? Si oui, comment stp ?
I have same issue, i installed expo-av in my project and i get it this error.
@Usama-Nazir Same issue here. Where you able to solve it?
anymore progress here? same issue for me
Same issue here.
Hi everyone, I haven't used this library recently, but this error is usually a sign that your native modules are not loaded.
This could happen if you use expo go, and it's missing a required native module. Expo team decides which modules are included in expo go, so it could be that they removed a module required by tfjs in expo go.
In any case, you should use expo dev client for development and testing, in which you can control which native modules are installed.
Hope this helps.
Same issue here.
This issue is not related to tensorflow it seems, but to expo - I think. But I also couldn't detect where it specifically comes from in my case.
Related to: https://github.com/expo/expo/issues/29568 https://github.com/expo/expo/issues/31018
The same error occurs when using Expo assets.
The same error occurs when attached the react-native-debugger "react-native": "0.75.2", "expo": "^51.0.0", "expo-file-system":"~17.0.1", "expo-image-picker": "~15.0.7", "expo-media-library": "~16.0.5",
I used bare project
Step 2: Install dependencies Note that if you are using in a managed expo app the install instructions may be different.
Install and configure react-native-unimodules (can be skipped if in an expo app) Install and configure expo-gl Install and configure expo-camera Install and configure async-storage Install and configure react-native-fs Install @tensorflow/tfjs - npm install @tensorflow/tfjs Install @tensorflow/tfjs-react-native - npm install @tensorflow/tfjs-react-native
I edited the tutorial on GitHub. it occured same error
Is there any solution?