skip to Main Content

I just updated my project’ SDK because the expo GO IOS app updated automatically to SDK51.
My project works fine with SDK 50.
But after updating, I got 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

Here is my package.json:

{
  "name": "client",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "lint": "eslint . --ext .js,.jsx ./",
    "lint-fix": "eslint . --ext .js,.jsx ./ --fix"
  },
  "dependencies": {
    "@babel/eslint-parser": "^7.23.10",
    "@gorhom/bottom-sheet": "^4.6.1",
    "@react-native-community/checkbox": "^0.5.17",
    "@react-navigation/bottom-tabs": "^6.5.11",
    "@react-navigation/drawer": "^6.6.15",
    "@react-navigation/material-top-tabs": "^6.6.5",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/native-stack": "^6.9.17",
    "@react-navigation/stack": "^6.3.20",
    "@reduxjs/toolkit": "^2.2.1",
    "antd": "^5.12.2",
    "deprecated-react-native-prop-types": "^5.0.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-plugin-import": "^2.29.1",
    "eslint-plugin-jsx-a11y": "^6.8.0",
    "eslint-plugin-react": "^7.34.0",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-native": "^4.1.0",
    "expo": "^51.0.0",
    "expo-build-properties": "~0.12.1",
    "expo-camera": "~15.0.6",
    "expo-image-picker": "~15.0.4",
    "expo-linear-gradient": "~13.0.2",
    "expo-media-library": "~16.0.3",
    "expo-status-bar": "~1.12.1",
    "firebase": "^10.11.0",
    "moment": "^2.29.4",
    "moti": "^0.28.1",
    "nativewind": "^2.0.11",
    "radio-buttons-react-native": "^1.0.4",
    "react": "18.2.0",
    "react-native": "0.74.1",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-pager-view": "6.3.0",
    "react-native-popover-view": "^5.1.8",
    "react-native-popup-menu": "^0.16.1",
    "react-native-reanimated": "~3.10.1",
    "react-native-reanimated-carousel": "^3.5.1",
    "react-native-redash": "^18.1.2",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "4.10.1",
    "react-native-screens": "3.31.1",
    "react-native-star-rating": "^1.1.0",
    "react-native-svg": "15.2.0",
    "react-native-swiper": "^1.6.0",
    "react-native-switch": "^1.5.1",
    "react-native-tab-view": "^3.5.2",
    "react-native-vector-icons": "^10.0.3",
    "react-redux": "^9.1.0",
    "redux": "^5.0.1",
    "tailwindcss": "3.3.2"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0",
    "@types/react": "~18.2.79",
    "@types/react-native": "^0.73.0",
    "eslint": "^8.57.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "prettier": "^3.2.5",
    "typescript": "~5.3.3"
  },
  "private": true
}

Help me pls. Thanks all.

I tried to update the react native version and some others solutions on stack overflow but it did not work.

2

Answers


  1. got the same issue and this one helped me :
    https://github.com/expo/expo/issues/28618

    Login or Signup to reply.
  2. I was getting the same error the what I did is that I deleted the node_modules and package_lock.json when and than ran npm install again all the errors were removed but then when i started the app it is not starting instead it shows something went wrong ( Network response timed out ) "

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search