question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR Invariant Violation: Module AppRegistry is not a registered callable module ( React native V6)

See original GitHub issue

Description

ERROR TypeError: undefined is not an object (evaluating ‘Object.keys(o)’) ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

Version

0.67

Output of npx react-native info

BUNDLE ./index.js

ERROR TypeError: undefined is not an object (evaluating ‘Object.keys(o)’) ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. [Info] Stopping Packager

Steps to reproduce

Whenever i am adding StackNavigator code in my App.js then showing above issue… I tried all possible solution to resolve it. but it’s showing same bug again and again.

Snack, code example, screenshot, or link to a repository

App.js `import {NavigationContainer} from ‘@react-navigation/native’; import React from ‘react’; import ‘react-native-gesture-handler’; import {createStackNavigator} from ‘react-navigation-stack’; import Home from ‘./Home’;

const Stack = createStackNavigator(); const SectionListBasics = () => { return ( <> <NavigationContainer> <Stack.Navigator initialRouteName=“Home” headerMode=“Screen”> <Stack.Screen name=“Home” options={{ headerShown: false, }}> {props => <Home {…props} username=“Sports Fan” />} </Stack.Screen> </Stack.Navigator> </NavigationContainer> </> ); };

export default SectionListBasics; `

package.json { "name": "AwesomeProject", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@react-native-community/masked-view": "^0.1.11", "@react-navigation/bottom-tabs": "^6.0.9", "@react-navigation/drawer": "^6.1.8", "@react-navigation/native": "^6.0.6", "react": "17.0.2", "react-native": "0.67.1", "react-native-gesture-handler": "^2.2.0", "react-native-reanimated": "^2.2.4", "react-native-safe-area-context": "^3.3.2", "react-native-screens": "^3.10.2", "react-native-vector-icons": "^9.0.0", "react-navigation-stack": "^2.10.4" }, "devDependencies": { "@babel/core": "7.16.10", "@babel/runtime": "7.16.7", "@react-native-community/eslint-config": "2.0.0", "babel-jest": "26.6.3", "eslint": "7.14.0", "jest": "26.6.3", "metro-react-native-babel-preset": "0.66.2", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } }

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:30

github_iconTop GitHub Comments

54reactions
phanithkencommented, Jan 26, 2022

This issue is mostly happen when node_modules folder has been changed by installing new library or some sort of action. Please try removing cache and do yarn install or npm install again

$ npx react-native-clean-project
$ yarn install
31reactions
punikercommented, Mar 29, 2022

Try to add this line in the file where you add the navigation:

import * as React from 'react';

this has worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - Module AppRegistry is not registered callable ...
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider...
Read more >
invariant violation: module appregistry is not a registered ...
Invariant Violation : Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application ......
Read more >
React-Native: Module AppRegistry is not a registered callable ...
Android : React - Native : Module AppRegistry is not a registered callable module [ Beautify Your Computer ...
Read more >
AppRegistry - React Native
You do not need to use this API. AppRegistry is the JS entry point to running all React Native apps. App root components...
Read more >
Using Storybook and MSW in React Native | Phelipe Teles
start() will result in an Error: not implemented message followed by Error: Invariant Violation: Module AppRegistry is not a registered callable ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found