Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) #29564

Closed
champion007 opened this issue Aug 4, 2020 · 22 comments
Labels
API: AppRegistry Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@champion007
Copy link

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"
  }
@react-native-bot react-native-bot added API: AppRegistry Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. and removed Needs: Triage 🔍 labels Aug 4, 2020
@github-actions
Copy link

github-actions bot commented Aug 4, 2020

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

@MihaiDev08
Copy link

MihaiDev08 commented Aug 4, 2020

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!

@champion007
Copy link
Author

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

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Aug 5, 2020
@safaiyeh safaiyeh added Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available and removed Needs: Attention Issues where the author has responded to feedback. Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. labels Aug 7, 2020
@github-actions
Copy link

github-actions bot commented Aug 7, 2020

⚠️ Missing Reproducible Example
ℹ️ 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.

@github-actions
Copy link

github-actions bot commented Aug 7, 2020

⚠️ Using Old Version
ℹ️ 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.

@littlepriest
Copy link

littlepriest commented Sep 21, 2020

:-( 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".

@yt-dev
Copy link

yt-dev commented Sep 28, 2020

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)

@markneh
Copy link

markneh commented Sep 29, 2020

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

@ramonvermeulen
Copy link

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

@enestatli
Copy link

rm -rf node_modules package-lock.json
npm install

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

@ghoshabhi
Copy link

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

@lexdenotter
Copy link

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

@tiagobnobrega
Copy link

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.

@evalenzuela
Copy link

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

@RoberManuki
Copy link

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!

@vosters
Copy link

vosters commented Dec 7, 2020

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?

@flyskywhy
Copy link
Contributor

In my case, after a git commit cause the error, then I found the wrong code in the commit is:

static emitter = Platform.OS === 'ios' ? new NativeEventEmitter(NativeModule) : DeviceEventEmitter;

where the NativeModule is null because I have not implemented it on iOS 😝

When I edit it to

static emitter = Platform.OS === 'ios' ? {} : DeviceEventEmitter;

then the error Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) is gone!

@imsam67
Copy link

imsam67 commented Dec 3, 2021

This definitely seems to be caused by developer error. In my case, a misspelled variable name in one of the util functions I was calling was the cause of the error.

Unfortunately, the error message doesn't say much and doesn't point to a particular place in the code. In my case, I pretty much spent the entire day troubleshooting so the whole day was wasted.

My suggestion to the next person who's having this issue is to stop complaining and pointing fingers and start looking at your code very very very carefully.

@gabsist
Copy link

gabsist commented Mar 19, 2022

rm -rf node_modules package-lock.json

It works for me! tks

@muhamedoufi
Copy link

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)

did you find solution?

@github-actions
Copy link

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 20, 2023
@github-actions
Copy link

This issue was closed because the author hasn't provided the requested feedback after 7 days.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: AppRegistry Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests