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 registered

Short 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 registerRootComponent runs.
  • package.json main points to the wrong file (with Expo Router it should be expo-router/entry).
  • The native app name differs from the name registered in JavaScript (bare React Native).

How to fix it

  1. Find and fix the first error above this message in the Metro or device logs.

  2. Check your entry point in package.json:

                          "main": "expo-router/entry"
                        
  3. Clear the cache and restart:

                          npx expo start --clear
                        

The same message may name your app instead, for example “"App" has not been registered”.

Let’s talk about the next step

Have an idea, a stuck app, or a workflow toimprove?

Tell me what you are building, what is blocking you, and what a successful outcome looks like.