React Native & Expo errors · Error 07 of 12
“"main" has not been registered” in React Native / Expo
By Muhammad Abdullah, full-stack, mobile and ai automation developer · Last reviewed
Invariant Violation: "main" has not been registeredShort answer
The app crashed before it could register its root component, or the entry point is misconfigured. Scroll up in the logs to the first red error — that is the real cause — and check the main field in package.json.
Common causes
- An error thrown while importing a file (often a missing native module or a bad import) before
registerRootComponentruns. package.jsonmainpoints to the wrong file (with Expo Router it should beexpo-router/entry).- The native app name differs from the name registered in JavaScript (bare React Native).
How to fix it
Find and fix the first error above this message in the Metro or device logs.
Check your entry point in package.json:
"main": "expo-router/entry"Clear the cache and restart:
npx expo start --clear
The same message may name your app instead, for example “"App" has not been registered”.