Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native: A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes

I have ben trying to create a mobile app with a Drawer with React Native.

I did everything what the document says.

Everything works fine except when i try to use;

import { createDrawerNavigator } from "@react-navigation/drawer";

const Drawer = createDrawerNavigator();

react-navigation drawer makes my app go crazy, and I've been searching online to fix it but literary there are no answers for this.

Full Error:

Error: Exception in HostFunction: expected 0 arguments, got 1, js engine: hermes
 ERROR  Invariant Violation: "main" 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.registerComponent` wasn't called., js engine: hermes

versions:

   "@react-navigation/drawer": "^6.6.7",
   "react-native-gesture-handler": "^2.15.0",
   "react-native-reanimated": "^3.7.0"

like image 223
Baran Öden Avatar asked Oct 14 '25 03:10

Baran Öden


1 Answers

For me downgrading the react-native-gesture-handler to 2.14.0 and react-native-reanimated to 3.6.2 worked, will for fix to updated these

like image 154
Rohil Khadgee Avatar answered Oct 19 '25 01:10

Rohil Khadgee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!