In my Expo project, I get this error when I try to test my application on an Android device using Expo Go.
ERROR TypeError: Cannot read property '__expo_module_name__' of undefined, 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
I had no clue what this means or what can I do to fix it. However, I have noticed that this problem is solved by just uninstalling the module expo-dev-client
.
Without expo-dev-client
, my local bundle works perfectly fine. However, after I install it with yarn expo install expo-dev-client
, I get the error shown above.
I am using version 49.0.0 of expo (which I believe is the latest) and this is my full package.json
file, in case it is of any help:
{
"name": "my_app_name",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"@gorhom/bottom-sheet": "4",
"@react-native-community/datetimepicker": "7.2.0",
"@react-native-community/slider": "4.4.2",
"@react-navigation/bottom-tabs": "^6.5.8",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"@reduxjs/toolkit": "^1.9.5",
"@rneui/base": "^4.0.0-rc.7",
"@rneui/themed": "^4.0.0-rc.7",
"@types/react-redux": "^7.1.25",
"async-mutex": "^0.4.0",
"axios": "^1.3.4",
"expo": "49.0.0",
"expo-av": "~13.4.1",
"expo-dev-client": "~2.4.6",
"expo-font": "^11.1.1",
"expo-navigation-bar": "~2.3.0",
"expo-secure-store": "~12.3.1",
"expo-status-bar": "~1.6.0",
"firebase": "^10.1.0",
"i18next": "^23.2.11",
"react": "18.2.0",
"react-hook-form": "^7.45.1",
"react-i18next": "^13.0.2",
"react-native": "0.72.3",
"react-native-flash-message": "^0.4.1",
"react-native-gesture-handler": "~2.12.0",
"react-native-input-select": "^1.1.1",
"react-native-modal-datetime-picker": "^17.0.0",
"react-native-pager-view": "6.2.0",
"react-native-reanimated": "~3.3.0",
"react-native-reanimated-carousel": "^3.4.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "^3.20.0",
"react-native-tab-view": "^3.5.2",
"react-redux": "^8.1.1",
"redux": "^4.2.1",
"redux-thunk": "^2.4.2",
"typescript": "^5.1.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"eslint": "^8.46.0",
"eslint-plugin-react": "^7.33.1"
},
"private": true
}
Is this a problem with expo-dev-client? It seems unlikely that expo fails with its own module for building. I do need to have this module in order to do development builds to test my application, so I have no idea where to go now.
All help is appreciated!
did you set jsEngine into app.json ?