React-native: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

Created on 4 Aug 2020  路  16Comments  路  Source: facebook/react-native

I have started getting this error Invariant Violation: _Module AppRegistry is not a registered callable module (calling runApplication)_ since yesterday, my application was working and all of sudden it broke.

Google for hours most of them asked to - Delete your yarn.lock/package-json.lock file and run yarn/npm install. Then try clearing cache with npx react-native start --reset-cache but none of iit worked.

Tried deleting re-building the app but it fails with the same error

index.js

import App from './App';
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => App);

package.json

"dependencies": {
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-community/datetimepicker": "^2.6.0",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/picker": "^1.6.5",
    "@react-native-community/slider": "^3.0.3",
    "@react-navigation/bottom-tabs": "^5.7.2",
    "@react-navigation/material-top-tabs": "^5.2.14",
    "@react-navigation/native": "^5.7.2",
    "@react-navigation/stack": "^5.8.0",
    "@types/react-native-svg-charts": "^5.0.3",
    "@types/react-redux": "^7.1.9",
    "lottie-ios": "3.1.8",
    "lottie-react-native": "^3.5.0",
    "moment": "^2.27.0",
    "react": "16.13.1",
    "react-moment": "^0.9.7",
    "react-native": "0.63.2",
    "react-native-gesture-handler": "^1.7.0",
    "react-native-reanimated": "^1.10.1",
    "react-native-safe-area-context": "^3.1.1",
    "react-native-screens": "^2.9.0",
    "react-native-svg": "^12.1.0",
    "react-native-svg-charts": "^5.4.0",
    "react-native-swipe-list-view": "^3.2.3",
    "react-native-swiper": "^1.6.0",
    "react-native-tab-view": "^2.15.0",
    "react-redux": "^7.2.1",
    "redux": "^4.0.5"
  }
AppRegistry Author Feedback Repro Verify on Latest Version

Most helpful comment

I got the same error today and after I run npm start or expo start again on my folder it worked.I hope it will work at you too!

All 16 comments

:warning: Missing Environment Information
:information_source: Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

I got the same error today and after I run npm start or expo start again on my folder it worked.I hope it will work at you too!

Tried it multiple times but it does not work :(

React-Native Info

info Fetching system and libraries information...
System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 202.43 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.2 - /usr/local/bin/node
    Yarn: 1.7.0 - /usr/local/bin/yarn
    npm: 6.14.5 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6241897
    Xcode: /undefined - /usr/bin/xcodebuild
  npmPackages:
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.2 => 0.63.2 
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native-git-upgrade: 0.2.7
    react-native: 0.61.5
:warning: Missing Reproducible Example
:information_source: It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.
:warning: Using Old Version
:information_source: It looks like you are using an older version of React Native. Please upgrade to the latest version, and verify if the issue persists. If it does not, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the current release.

:-( oh no, it is my mistake.....when my react native project launches, it needs to import some native files. These definitions wrote in file "app.js" like this:
import {
exampleFile1,
exampleFile2
} from './path';

and i suddenly found that there are no files named 'exampleFile1' or 'exampleFile2'.....


I also have this problem. and this is the result i ran the command "react-native info":

System:
OS: macOS 10.15.6
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 305.91 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.4 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.6 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
Languages:
Java: Not Found
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

failed to install the package "@react-native-community/cli: " and " react-native-macos".

I get the same error, (react-native version 0.63.2)
ERROR TypeError: Super expression must either be null or a function
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

I also had same issue. However, I updated react-native-keyboard-aware-scroll-view from 0.9.1 to 0.9.2 and it fixed the issue for me

Getting the same error right here.. react-native 0.63.2

rm -rf node_modules package-lock.json
npm install

worked for me, tested on both react-native version 0.63.2/3

package-lock.json should never be deleted. That is the whole purpose of having the lock file.

I also have the same error here on RN 0.63.3..

I was having the same error. But this message was also displayed:
TypeError: undefined is not an object (evaluating 'b.apply')

I've managed to trace it back to this in my Redux Store:

(window as any).__REDUX_DEVTOOLS_EXTENSION__ &&
      (window as any).__REDUX_DEVTOOLS_EXTENSION__(),

After removing this, It worked again in my case. I'm guessing this happens when some exception is thrown early on app loading.

I was just having same error. In my case the error was related to node version.

I got the same error today and after I run npm start or expo start again on my folder it worked.I hope it will work at you too!

Also worked for me!

I was just having same error. In my case the error was related to node version.

@evalenzuela I just updated my node and am now getting this issue. Can you explain what you did to resolve? And what version of node you were on?

Was this page helpful?
0 / 5 - 0 ratings