ReferenceError: Property ‘BeforeUnloadEvent’ doesn’t exist, 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 have been getting this error while compiling my react native and trying to run it in my android emulator.
Same thing happens with ios as well with expo.
The error says Metro is running in wrong folder, but i have closed all metro instances that might be running in different folder and also i have tried reinstalling all the dependancies and all the node-modules but nothing seems to work. this is my app.json {
“expo”: {
“name”: “expense-tracker-app”,
“slug”: “expense-tracker-app”,
“version”: “1.0.0”,
“orientation”: “portrait”,
“icon”: “./assets/icon.png”,
“userInterfaceStyle”: “light”,
“splash”: {
“image”: “./assets/splash.png”,
“resizeMode”: “contain”,
“backgroundColor”: “#ffffff”
},
“ios”: {
“supportsTablet”: true
},
“android”: {
“adaptiveIcon”: {
“foregroundImage”: “./assets/adaptive-icon.png”,
“backgroundColor”: “#ffffff”
}
},
“web”: {
“favicon”: “./assets/favicon.png”
}
}
} and this is my package.json {
“name”: “expense-tracker-app”,
“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”: {
“@react-navigation/bottom-tabs”: “^6.6.0”,
“@react-navigation/native”: “^6.1.17”,
“@react-navigation/native-stack”: “^6.10.0”,
“expo”: “~51.0.17”,
“expo-status-bar”: “~1.12.1”,
“react”: “18.2.0”,
“react-native”: “^0.74.3”,
“react-native-safe-area-context”: “4.10.1”,
“react-native-screens”: “3.31.1”
},
“devDependencies”: {
“@babel/core”: “^7.20.0”
},
“private”: true
}
Fyi, this is a expo project with blank template and just js and jsx
Ishan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.