I’m developing an app that so far has worked well and I haven’t touched it for 2 days and now as soon as I tried to make it work it stopped working and it gives me this error I don’t know what happened: I also tried to create a new one project and re-enter the codes but it always gives me this cursed error: iOS Bundling complete 76ms
ERROR TypeError: Cannot read property ‘array’ 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
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "~49.0.15",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-native": "0.72.6",
"@expo/vector-icons": "^13.0.0",
"@react-native-community/viewpager": "5.0.11",
"@react-native-picker/picker": "2.4.10",
"@react-navigation/bottom-tabs": "^6.5.11",
"@react-navigation/native": "^6.1.9",
"@react-navigation/stack": "^6.3.20",
"axios": "^1.6.2",
"cron": "^3.1.6",
"expo-constants": "~14.4.2",
"expo-dev-client": "~2.4.12",
"expo-device": "~5.4.0",
"expo-image-picker": "~14.3.2",
"expo-notifications": "~0.20.1",
"expo-server-sdk": "^3.7.0",
"express": "^4.18.2",
"multer": "^1.4.5-lts.1",
"react-native-elements": "^3.4.3",
"react-native-gesture-handler": "~2.12.0",
"react-native-image-picker": "^7.1.0",
"react-native-paper": "^5.11.4",
"react-native-reanimated": "~3.3.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-snap-carousel": "^1.3.1",
"react-native-vector-icons": "^10.0.2",
"react-native-video": "^5.2.1",
"react-native-webview": "13.2.2",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.10.4"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}
2
Answers
I finally solved it by cleaning the cache but not only did I have to remove some deprecations
Whenever I hit this error, often what works for me is to just restart everything and clear my cache.
yarn start --reset-cache
. Though in your case it would beexpo start -c