facebook/react-native

Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). When Upgrading To React Native v0.70

nmassey2 opened this issue ยท 248 comments

Description

Upgrade from 0.68.1 to 0.70.0.
Builds fine in Xcode.
Launches Simulator.
Splash screen for app appears.

and then it crashes with the error:

ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
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., js engine: hermes

Version

0.70.0

Output of npx react-native info

ystem:
OS: macOS 12.3.1
CPU: (4) x64 Intel(R) Core(TM) i7-4578U CPU @ 3.00GHz
Memory: 1.20 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.15.0 - /usr/local/bin/node
Yarn: Not Found
npm: 8.5.5 - /usr/local/bin/npm
Watchman: 2022.03.21.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

Upgrade from 0.68.1 to 0.70.0.
Builds fine in Xcode.
Launches Simulator.
Splash screen for app appears.

and then it crashes with the error:

ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
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., js engine: hermes

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

Screen Shot 2022-09-14 at 7 06 35 AM

i have the same issue

i have the same issue too

Same here too

I succeed to avoid this error. In my case, it was due to the react-native-gesture-handler that changed.

Previously we needed to import it at the top of the root file, now we must do that in App.js instead

import { GestureHandlerRootView } from 'react-native-gesture-handler';
/* ... */
// Wrap your app with the new GestureHandler
<GestureHandlerRootView style={{ flex: 1 }}>
  /* your app */
</GestureHandlerRootView>

Hope it will help

i have the same issue too

Also having this issue

In my case it was ViewPropTypes from react-native-camera, I've applied this patch:

diff --git a/node_modules/react-native-camera/src/RNCamera.js b/node_modules/react-native-camera/src/RNCamera.js
index b7a271a..bf729e6 100644
--- a/node_modules/react-native-camera/src/RNCamera.js
+++ b/node_modules/react-native-camera/src/RNCamera.js
@@ -1,11 +1,11 @@
 // @flow
 import React from 'react';
 import PropTypes from 'prop-types';
+import {ViewPropTypes} from 'deprecated-react-native-prop-types';
 import {
   findNodeHandle,
   Platform,
   NativeModules,
-  ViewPropTypes,
   requireNativeComponent,
   View,
   ActivityIndicator,

and the error went away, note that I hade to manually install: yarn add deprecated-react-native-prop-types.

The error you have above is incomplete, you're missing this important part:

TypeError: undefined is not an object (evaluating '_reactnative.Text.propTypes.style')

I succeed to avoid this error. In my case, it was due to the react-native-gesture-handler that changed.

Previously we needed to import it at the top of the root file, now we must do that in App.js instead

import { GestureHandlerRootView } from 'react-native-gesture-handler';
/* ... */
// Wrap your app with the new GestureHandler
<GestureHandlerRootView style={{ flex: 1 }}>
  /* your app */
</GestureHandlerRootView>

Hope it will help

Not worked for me.

Any update on the same ? react-native-bot

I found that, similar to the OP, I had an error listed above the 'Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication().'. (In my case, the error was "Invariant Violation: ViewPropTypes has been removed from React Native", which was caused by two libraries in the node_modules folder). When I fixed that error (by applying patches to those libraries), the two 'AppRegistry' errors disappeared as well.

any update on the issues?

Same issue here after upgrading all of dependencies my old project with yarn yarn yarn-upgrade-all

image

my package.json:

{
  "name": "-",
  "version": "0.0.1",
  "osmiVersion": "1.1.0",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start --reset-cache",
    "test": "jest",
    "lint": "eslint .",
    "format": "prettier --check ./App"
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^6.2.0",
    "@fortawesome/free-brands-svg-icons": "^6.2.0",
    "@fortawesome/free-regular-svg-icons": "^6.2.0",
    "@fortawesome/pro-light-svg-icons": "^6.2.0",
    "@fortawesome/pro-regular-svg-icons": "^6.2.0",
    "@fortawesome/pro-solid-svg-icons": "^6.2.0",
    "@fortawesome/react-native-fontawesome": "^0.3.0",
    "@monterosa/react-native-parallax-scroll": "^1.8.0",
    "@react-native-async-storage/async-storage": "^1.17.10",
    "@react-native-community/datetimepicker": "^6.3.4",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-firebase/analytics": "^15.6.0",
    "@react-native-firebase/app": "^15.6.0",
    "@react-native-firebase/messaging": "^15.6.0",
    "@react-native-firebase/perf": "^15.6.0",
    "@react-navigation/bottom-tabs": "^6.4.0",
    "@react-navigation/drawer": "^6.5.0",
    "@react-navigation/native": "^6.0.13",
    "@react-navigation/stack": "^6.3.1",
    "@sentry/react-native": "5.0.0-alpha.1",
    "add": "^2.0.6",
    "apisauce": "^2.1.6",
    "dayjs": "^1.11.5",
    "enzyme": "^3.11.0",
    "enzyme-adapter-react-16": "^1.15.6",
    "formik": "^2.2.9",
    "lodash": "^4.17.21",
    "osmicsx": "^0.6.10",
    "prop-types": "^15.8.1",
    "ramda": "^0.28.0",
    "react": "^18.2.0",
    "react-native": "^0.70.1",
    "react-native-animatable": "^1.3.3",
    "react-native-autoheight-webview": "^1.6.4",
    "react-native-background-downloader": "^2.3.4",
    "react-native-config": "^1.4.6",
    "react-native-device-info": "^10.2.0",
    "react-native-dropdown-picker": "^5.4.2",
    "react-native-fast-image": "^8.6.1",
    "react-native-file-viewer": "^2.1.5",
    "react-native-fluid-transitions": "^0.1.1",
    "react-native-gallery-swiper": "^1.26.4",
    "react-native-geolocation-service": "^5.3.0",
    "react-native-gesture-handler": "^2.6.1",
    "react-native-image-crop-picker": "^0.38.0",
    "react-native-intl-phone-input": "^1.2.27",
    "react-native-keyboard-spacer": "^0.4.1",
    "react-native-linear-gradient": "^2.6.2",
    "react-native-localize": "^2.2.3",
    "react-native-modal": "^13.0.1",
    "react-native-modal-datetime-picker": "^14.0.0",
    "react-native-modal-selector": "^2.1.1",
    "react-native-multiple-select": "^0.5.11",
    "react-native-parallax-scroll-view": "^0.21.3",
    "react-native-passkit-wallet": "^0.1.6",
    "react-native-reanimated": "^2.10.0",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "^4.3.4",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-screens": "^3.17.0",
    "react-native-shared-element": "^0.8.4",
    "react-native-shimmer-placeholder": "^2.0.9",
    "react-native-simple-toast": "^1.1.4",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-svg": "^13.2.0",
    "react-native-swiper": "^1.6.0",
    "react-native-vector-icons": "^9.2.0",
    "react-native-video": "^5.2.1",
    "react-native-video-player": "^0.14.0",
    "react-native-webview": "^11.23.1",
    "react-navigation-shared-element": "^3.1.3",
    "react-redux": "^8.0.2",
    "reactotron-react-native": "^5.0.2",
    "redux": "^4.2.0",
    "redux-persist": "^6.0.0",
    "redux-saga": "^1.2.1",
    "reduxsauce": "^1.2.1",
    "rn-fetch-blob": "^0.12.0",
    "seamless-immutable": "^7.1.4",
    "url-parse": "^1.5.10",
    "yarn": "^1.22.19",
    "yarn-upgrade-all": "^0.7.1",
    "yup": "^0.32.11"
  },
  "devDependencies": {
    "@babel/core": "^7.19.1",
    "@babel/runtime": "^7.19.0",
    "@react-native-community/eslint-config": "^3.1.0",
    "babel-jest": "^29.0.3",
    "babel-plugin-ignite-ignore-reactotron": "^0.3.0",
    "eslint": "^8.23.1",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-react": "^7.31.8",
    "jest": "^29.0.3",
    "metro-react-native-babel-preset": "^0.72.3",
    "prettier": "^2.7.1",
    "react-dom": "^18.2.0",
    "react-native-svg-transformer": "^1.0.0",
    "react-test-renderer": "^18.2.0",
    "reactotron-redux": "^3.1.3",
    "reactotron-redux-saga": "^4.2.3"
  },
  "jest": {
    "preset": "react-native",
    "testMatch": [
      "<rootDir>/Tests/**/*.js",
      "**/?(*.)(spec|test).js?(x)"
    ],
    "testPathIgnorePatterns": [
      "/node_modules/",
      "<rootDir>/Tests/Setup.js"
    ],
    "moduleNameMapper": {
      "^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "identity-obj-proxy"
    },
    "transform": {
      "^.+\\.(js)$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
    },
    "setupFiles": [
      "<rootDir>/Tests/Setup"
    ]
  },
  "config": {},
  "standard": {
    "parser": "babel-eslint",
    "globals": [
      "describe",
      "test",
      "jest",
      "expect",
      "fetch",
      "navigator",
      "__DEV__",
      "XMLHttpRequest",
      "FormData",
      "React$Element"
    ]
  }
}

I have the same issue

package.json deps

"dependencies": {
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-native-community/blur": "^4.2.0",
"@react-native-community/push-notification-ios": "^1.10.1",
"@react-native-community/slider": "^3.0.3",
"@react-native-firebase/analytics": "^15.6.0",
"@react-native-firebase/app": "^15.6.0",
"@react-native-firebase/crashlytics": "^15.6.0",
"@react-native-firebase/messaging": "^15.6.0",
"@react-native-firebase/remote-config": "^15.6.0",
"@react-native-masked-view/masked-view": "^0.2.7",
"@react-native-picker/picker": "^2.3.0",
"@react-navigation/drawer": "^6.5.0",
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.9.0",
"@react-navigation/stack": "^6.2.0",
"axios": "^0.21.2",
"crypto-js": "^3.3.0",
"date-fns": "^2.29.2",
"deprecated-react-native-prop-types": "^2.3.0",
"lottie-react-native": "^5.0.1",
"polished": "^4.1.1",
"react": "18.1.0",
"react-native": "0.70.1",
"react-native-appsflyer": "^6.5.21",
"react-native-background-fetch": "^4.0.5",
"react-native-camera": "^3.40.0",
"react-native-check-version": "^1.0.16",
"react-native-code-push": "^7.0.5",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.2",
"react-native-currency-input": "^1.0.1",
"react-native-date-picker": "^4.1.1",
"react-native-device-info": "^10.0.2",
"react-native-dialog": "^9.1.2",
"react-native-document-picker": "^7.1.0",
"react-native-fast-image": "^8.5.11",
"react-native-flash-message": "^0.1.23",
"react-native-format-currency": "^0.0.3",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^2.6.0",
"react-native-google-mobile-ads": "^5.0.0",
"react-native-image-picker": "^4.7.3",
"react-native-in-app-review": "^3.2.2",
"react-native-iphone-x-helper": "^1.3.1",
"react-native-linear-gradient": "^2.6.2",
"react-native-localization": "^2.1.7",
"react-native-localize": "^2.1.1",
"react-native-paper": "^4.9.2",
"react-native-permissions": "^3.0.5",
"react-native-phone-number-input": "^2.1.0",
"react-native-picker-select": "^8.0.4",
"react-native-purchases": "^5.0.2",
"react-native-push-notification": "^8.1.0",
"react-native-qrcode-scanner": "^1.5.1",
"react-native-reanimated": "^2.10.0",
"react-native-safe-area-context": "^4.3.1",
"react-native-screens": "^3.14.1",
"react-native-share": "^7.2.0",
"react-native-splash-screen": "^3.2.0",
"react-native-uuid-generator": "^6.1.1",
"react-native-vector-icons": "^8.1.0",
"react-native-zip-archive": "^6.0.3",
"react-number-format": "^4.4.1",
"realm": "^11.0.0-rc.2",
"styled-components": "^5.3.1",
"xlsx": "^0.17.0",
"yup": "^0.32.9"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/preset-typescript": "^7.16.7",
"@babel/runtime": "^7.15.3",
"@react-native-community/eslint-config": "^3.0.0",
"@rnx-kit/dep-check": "^1.13.0",
"@types/crypto-js": "^3.1.47",
"@types/jest": "^27.4.1",
"@types/react-native": "^0.64.2",
"@types/react-native-push-notification": "^5.0.5",
"@types/react-native-share": "^3.3.0",
"@types/react-native-uuid-generator": "^4.0.0",
"@types/react-native-vector-icons": "^6.4.5",
"@types/react-test-renderer": "^17.0.1",
"@types/styled-components-react-native": "^5.1.1",
"@typescript-eslint/eslint-plugin": "^3.9.1",
"@typescript-eslint/parser": "^3.9.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-import-resolver-typescript": "^2.2.1",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^2.5.0",
"jest": "^26.6.3",
"jetifier": "^1.6.6",
"metro-react-native-babel-preset": "^0.72.1",
"patch-package": "^6.2.2",
"prettier": "^2.0.5",
"react-native-typescript-transformer": "^1.2.13",
"react-test-renderer": "18.1.0",
"ts-jest": "^27.1.4",
"typescript": "^4.4.3"
},
Screen Shot 2022-09-20 at 14 29 45

my colleague @lirazhad was able to fix it by applying this patch package on react-native 0.70.0 itself!
don't forget to add this dependency into your package.json.
"deprecated-react-native-prop-types": "^2.3.0",

diff --git a/node_modules/react-native/index.js b/node_modules/react-native/index.js
index d59ba34..8023167 100644
--- a/node_modules/react-native/index.js
+++ b/node_modules/react-native/index.js
@@ -435,32 +435,16 @@ module.exports = {
   },
   // Deprecated Prop Types
   get ColorPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'ColorPropType has been removed from React Native. Migrate to ' +
-        "ColorPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").ColorPropType
   },
   get EdgeInsetsPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'EdgeInsetsPropType has been removed from React Native. Migrate to ' +
-        "EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").EdgeInsetsPropType
   },
   get PointPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'PointPropType has been removed from React Native. Migrate to ' +
-        "PointPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").PointPropType
   },
   get ViewPropTypes(): $FlowFixMe {
-    invariant(
-      false,
-      'ViewPropTypes has been removed from React Native. Migrate to ' +
-        "ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").ViewPropTypes
   },
 };

source: 
https://github.com/facebook/react-native/issues/33734#issuecomment-1206494929

any update? same issue

my colleague was able to fix it by applying this patch package on react-native 0.70.0 itself! don't forget to add this dependency into your package.json. "deprecated-react-native-prop-types": "^2.3.0",

diff --git a/node_modules/react-native/index.js b/node_modules/react-native/index.js
index d59ba34..8023167 100644
--- a/node_modules/react-native/index.js
+++ b/node_modules/react-native/index.js
@@ -435,32 +435,16 @@ module.exports = {
   },
   // Deprecated Prop Types
   get ColorPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'ColorPropType has been removed from React Native. Migrate to ' +
-        "ColorPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").ColorPropType
   },
   get EdgeInsetsPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'EdgeInsetsPropType has been removed from React Native. Migrate to ' +
-        "EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").EdgeInsetsPropType
   },
   get PointPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'PointPropType has been removed from React Native. Migrate to ' +
-        "PointPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").PointPropType
   },
   get ViewPropTypes(): $FlowFixMe {
-    invariant(
-      false,
-      'ViewPropTypes has been removed from React Native. Migrate to ' +
-        "ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").ViewPropTypes
   },
 };

source: 
https://github.com/facebook/react-native/issues/33734#issuecomment-1206494929

I tried. Same issue !

my colleague was able to fix it by applying this patch package on react-native 0.70.0 itself! don't forget to add this dependency into your package.json. "deprecated-react-native-prop-types": "^2.3.0",

diff --git a/node_modules/react-native/index.js b/node_modules/react-native/index.js
index d59ba34..8023167 100644
--- a/node_modules/react-native/index.js
+++ b/node_modules/react-native/index.js
@@ -435,32 +435,16 @@ module.exports = {
   },
   // Deprecated Prop Types
   get ColorPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'ColorPropType has been removed from React Native. Migrate to ' +
-        "ColorPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").ColorPropType
   },
   get EdgeInsetsPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'EdgeInsetsPropType has been removed from React Native. Migrate to ' +
-        "EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").EdgeInsetsPropType
   },
   get PointPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'PointPropType has been removed from React Native. Migrate to ' +
-        "PointPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").PointPropType
   },
   get ViewPropTypes(): $FlowFixMe {
-    invariant(
-      false,
-      'ViewPropTypes has been removed from React Native. Migrate to ' +
-        "ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require("deprecated-react-native-prop-types").ViewPropTypes
   },
 };

source: 
https://github.com/facebook/react-native/issues/33734#issuecomment-1206494929

I tried. Same issue !

jayscottthomas wow I don't know, anyway why i did is not viable, React strongly do not recommend a such patch-package.

It's also not recommend to use patch-package on the React Native file because this will only mask the issue.
#33734 (comment)

What I smell is that there is no choice, each of use MUST identify which 3rd party uses the forbidden type, and try to update it, or to fix it by opening a PR in the 3rd repo itself. [the pb is that search in my node_modules, and no trace of a such deprecated type!]
React are clear, they do not intend to fix this !
#33734 (comment)

  • The approach of the react native team in releasing the new updates is wrong. Their duty is just to release a working react native package. The react native on its own without the thousands of other packages is useless.
  • The real cause of errors also in the recent releases is not clear.
  • By suggestion of someone after many hours of searching, I ran: npm start --reset-cache
  • two packages (react-native-vector-icons AND react-native-navigations) are showing the error: invalid configuration: "dependency.assets" is not allowed,"dependency.hooks" is not allowed.
  • At the moment, react-native-navigations is not supporting the New Architecture.
  • These packages are very popular and the core of applications for so many developers. The react native team should be in contact with the maintainers of these packages or at least warn the developers before upgrading by a message like: By updating the React Native to x.x.x version, These packages are not supported.

Now after wasting so much time, I have to downgrade to 0.68

what version should i try ?? i tried everything same issue

what version should i try ?? i tried everything same issue

do not use/upgraded to latest version for the while. patching isn't good

thanks now it working after moving to react native 0.68 version

How can i downgrade the React Native version? I just tried changing the version in the package.json and then runnning 'npm install' and my whole project exploded. React Native CLI, doesn't seem to let you downgrade as well, only upgrade

what do you mean @... react-native@0.69.5?
It just explodes with every other dependency. I tried generating a bare new react-native in version 0.69.5 and it isnt working either.

do you usually just run npm install react-native@..** and it downgrades without dependency collision?

@marcodiloreto
Unfortunately, you need to check and apply the changes manually after npm install react-native@x.x.x.
use this tool: https://react-native-community.github.io/upgrade-helper/?from=0.68.0&to=0.70.1
(you delete the green lines of code from the right side and replace them with the red lines of code on the left side.)

Then:
Delete Pods folder and Podfile.lock

cd ios
pod update && pod install

If you have a copy of the whole folder of your project(before the upgrade), you can simply replace it. but it seems you don't have any.

Good Luck

I succeed to avoid this error. In my case, it was due to the react-native-gesture-handler that changed.
Previously we needed to import it at the top of the root file, now we must do that in App.js instead

import { GestureHandlerRootView } from 'react-native-gesture-handler';
/* ... */
// Wrap your app with the new GestureHandler
<GestureHandlerRootView style={{ flex: 1 }}>
  /* your app */
</GestureHandlerRootView>

Hope it will help

Not worked for me.

Yes, before not worked for me. but after again i removed below lines.

import { GestureHandlerRootView } from 'react-native-gesture-handler';
/* ... /
// Wrap your app with the new GestureHandler
<GestureHandlerRootView style={{ flex: 1 }}>
/
your app */

I am facing same issue when I create release build, not on debug builds. Is it same for everyone?

Any one can solve this issue
#34688 (comment)

same issue, how to resolve?

I succeed to avoid this error. In my case, it was due to the react-native-gesture-handler that changed.

Previously we needed to import it at the top of the root file, now we must do that in App.js instead

import { GestureHandlerRootView } from 'react-native-gesture-handler';
/* ... */
// Wrap your app with the new GestureHandler
<GestureHandlerRootView style={{ flex: 1 }}>
  /* your app */
</GestureHandlerRootView>

Hope it will help

no work

In our case we are upgrading from 0.65.1to 0.70.1after xcode update. Stripe seemed to break the xcode build.

What has worked well in the past when the builds break, is that we start with a 0.70.1 hello world application and then slowly integrate our existing app in by bringing in the various modules and wrapping the h/w app inside them etc etc

What we noticed in this occasion that when we updated index.js to the current app code then we got this error. By process of elimination by commenting out all references till we got the h/w app back again and then bringing back each reference one by one till it broke.

In this case it looks like @aws-amplify/pushnotification package is the current culprit so we are now looking at upgrading that package etc etc to see if we can resolve and then likely move onto the next one.

Become a developer they said....
It will be fun they said....

Looks like react native team doesnt care about this, Our project was delayed. We will try to downgrade if it will work.

While creating android build I set proguard to false and that worked for me.

Temporary solution for me.

@react-native-bot , pls update on this issue - we're struck after the upgrade to the latest. No choice but to downgrade for now.

@heroshinn itโ€™s not up to the meta devs, itโ€™s up to the library maintainers to catch up, there were many changes introduced in 0.70 so everyone need to be patient here and not rush to upgrade to 0.70.

The best thing to do in general is to stay 2 major versions behind from the latest one and keep an eye on the repos of the packages youโ€™re using for compatibility updates.

Even major libraries like react-native-screens had a 0.70 compat update just yesterday, long time after 0.70 came out.

ps. rn is still on 0.xx, just saying, breaking changes are expected on every major update.

I have the same issue

package.json deps

"dependencies": {
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-native-community/blur": "^4.2.0",
"@react-native-community/push-notification-ios": "^1.10.1",
"@react-native-community/slider": "^3.0.3",
"@react-native-firebase/analytics": "^15.6.0",
"@react-native-firebase/app": "^15.6.0",
"@react-native-firebase/crashlytics": "^15.6.0",
"@react-native-firebase/messaging": "^15.6.0",
"@react-native-firebase/remote-config": "^15.6.0",
"@react-native-masked-view/masked-view": "^0.2.7",
"@react-native-picker/picker": "^2.3.0",
"@react-navigation/drawer": "^6.5.0",
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.9.0",
"@react-navigation/stack": "^6.2.0",
"axios": "^0.21.2",
"crypto-js": "^3.3.0",
"date-fns": "^2.29.2",
"deprecated-react-native-prop-types": "^2.3.0",
"lottie-react-native": "^5.0.1",
"polished": "^4.1.1",
"react": "18.1.0",
"react-native": "0.70.1",
"react-native-appsflyer": "^6.5.21",
"react-native-background-fetch": "^4.0.5",
"react-native-camera": "^3.40.0",
"react-native-check-version": "^1.0.16",
"react-native-code-push": "^7.0.5",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.2",
"react-native-currency-input": "^1.0.1",
"react-native-date-picker": "^4.1.1",
"react-native-device-info": "^10.0.2",
"react-native-dialog": "^9.1.2",
"react-native-document-picker": "^7.1.0",
"react-native-fast-image": "^8.5.11",
"react-native-flash-message": "^0.1.23",
"react-native-format-currency": "^0.0.3",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^2.6.0",
"react-native-google-mobile-ads": "^5.0.0",
"react-native-image-picker": "^4.7.3",
"react-native-in-app-review": "^3.2.2",
"react-native-iphone-x-helper": "^1.3.1",
"react-native-linear-gradient": "^2.6.2",
"react-native-localization": "^2.1.7",
"react-native-localize": "^2.1.1",
"react-native-paper": "^4.9.2",
"react-native-permissions": "^3.0.5",
"react-native-phone-number-input": "^2.1.0",
"react-native-picker-select": "^8.0.4",
"react-native-purchases": "^5.0.2",
"react-native-push-notification": "^8.1.0",
"react-native-qrcode-scanner": "^1.5.1",
"react-native-reanimated": "^2.10.0",
"react-native-safe-area-context": "^4.3.1",
"react-native-screens": "^3.14.1",
"react-native-share": "^7.2.0",
"react-native-splash-screen": "^3.2.0",
"react-native-uuid-generator": "^6.1.1",
"react-native-vector-icons": "^8.1.0",
"react-native-zip-archive": "^6.0.3",
"react-number-format": "^4.4.1",
"realm": "^11.0.0-rc.2",
"styled-components": "^5.3.1",
"xlsx": "^0.17.0",
"yup": "^0.32.9"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/preset-typescript": "^7.16.7",
"@babel/runtime": "^7.15.3",
"@react-native-community/eslint-config": "^3.0.0",
"@rnx-kit/dep-check": "^1.13.0",
"@types/crypto-js": "^3.1.47",
"@types/jest": "^27.4.1",
"@types/react-native": "^0.64.2",
"@types/react-native-push-notification": "^5.0.5",
"@types/react-native-share": "^3.3.0",
"@types/react-native-uuid-generator": "^4.0.0",
"@types/react-native-vector-icons": "^6.4.5",
"@types/react-test-renderer": "^17.0.1",
"@types/styled-components-react-native": "^5.1.1",
"@typescript-eslint/eslint-plugin": "^3.9.1",
"@typescript-eslint/parser": "^3.9.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-import-resolver-typescript": "^2.2.1",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^2.5.0",
"jest": "^26.6.3",
"jetifier": "^1.6.6",
"metro-react-native-babel-preset": "^0.72.1",
"patch-package": "^6.2.2",
"prettier": "^2.0.5",
"react-native-typescript-transformer": "^1.2.13",
"react-test-renderer": "18.1.0",
"ts-jest": "^27.1.4",
"typescript": "^4.4.3"
},
Screen Shot 2022-09-20 at 14 29 45

Did you manage to solve it? I face same issue

Hi Folks, I would like to suggest you all to upgrade the Patched RN version 0.70.3

Change Log - #34958

npx react-native upgrade 0.70.3

@jyotiprakash111 I tried upgrading now, but did not work too.

ugglr commented

I have this issue, upgrading to 0.70.3 does not work for me.

EDIT: I got my app working again by updating all my packages in package.json. I can't say which one did the trick but it's probably more than one. React native navigation and all peer dependencies, react native reanimated, and others could probably all cause this type of error.

I guess you all getting the same issue due to react-native-reanimated 2.10 or 2.11. Try to downgrade to version 2.5 and try again. If it works, let me know in the comments and we should try to find the fix in RN reanimated

Same issue, just started learning react native, yesterday the app was working perfectly fine, today it's gone to sh*t.

I was upgrade react-native from 0.67.3 to 0.70.3.

In my case problem was with: ColorPropType, EdgeInsetsPropType, PointPropType, ViewPropTypes.

My steps to resolve this issue:

  1. yarn add patch-package
  2. add script to the scripts at the package.json "postinstall": patch-package"
  3. yarn add deprecated-react-native-prop-type
  4. Go to node_modules/react-native/Libraries/InitializeCore.js
  5. In 47 line (after require('../LogBox/LogBox').install(); } add: require('../ReactNative/AppRegistry');
  6. npx patch-package react-native
  7. Now should be visible errors related with ColorPropType, EdgeInsetsPropType, PointPropType, ViewPropTypes
  8. To resolve it change all deprecated imports for example import { EdgeInsetsPropType } from 'react-native' on import { EdgeInsetsPropType } from 'deprecated-react-native-prop-types';
  9. npx patch-package LIBRARY_NAME

having same issue after upgrading version from 0.67.3 to 0.70.3. any update on this ??
Screenshot 2022-10-18 at 6 10 23 PM

@SusulAdam
I was upgrading from 0.63.4 to 0.70.3. Your tips worked here. I updated some libraries to the latest. Some of then already includes the necessary changes. And the remaining one, I did the patch referencing the deprecated-react-native-prop-type

Thank you so much!

#34688 (comment)

I was upgrade react-native from 0.67.3 to 0.70.3.

In my case problem was with: ColorPropType, EdgeInsetsPropType, PointPropType, ViewPropTypes.

My steps to resolve this issue:

  1. yarn add patch-package
  2. add script to the scripts at the package.json "postinstall": patch-package"
  3. yarn add deprecated-react-native-prop-type
  4. Go to node_modules/react-native/Libraries/InitializeCore.js
  5. In 47 line (after require('../LogBox/LogBox').install(); } add: require('../ReactNative/AppRegistry');
  6. npx patch-package react-native
  7. Now should be visible errors related with ColorPropType, EdgeInsetsPropType, PointPropType, ViewPropTypes
  8. To resolve it change all deprecated imports for example import { EdgeInsetsPropType } from 'react-native' on import { EdgeInsetsPropType } from 'deprecated-react-native-prop-types';
  9. npx patch-package LIBRARY_NAME

Thank you very much, with your tips I could figure out which lib caused the issue on my side!

Iยดve just tried to upgrade from 0.68.2 to 0.70.3 without success!

I've updated all libraries, which were using ColorPropType, EdgeInsetsPropType, PointPropType, ViewPropTypes from "react-native" package. Done it through search in node_modules.

Updated from 0.68.4 to 0.70.3
Now it works

hi,
same pb : for me it was Axios : good in v0.27.2, and thoses messages when I jumped to 11.3 ! @jasonsaayman

hi,
same pb : for me it was Axios : good in v0.27.2, and thoses messages when I jumped to 11.3 ! @jasonsaayman

This was my issue as well, downgraded to axios v0.27.2 and everything worked fine.

With me also the problem was axios, I solved the problem by downgrading to version 0.27.2

In case someone is experiencing this issue and have the packages 'lottie-ios" and "lottie-react-native" installed, in my case upgrade them to latest version stopped the error. I'm using react native v0.70., lottie-ios v3.4.0 and lottie-react-native v5.1.4.

With me also the problem was axios, I solved the problem by downgrading to version 0.27.2

Which version were you using prior to the downgrade?

Hi, I was on 0.27.2, I upgraded to 1.1.3 (sorry for the typo in previous post) , without changing my code, I had the bug, I decreased back to 0.27.2, all was ok back after a yarn start --reset-cache . Do you want more infos, tests , code ?

Just one question using Common JS or TS with ESM?

I use ESM (import a from "./a") in JS

axios 1.1.3 is the problem, downgrade to 0.27.2

for me it's 'injectionStore' which is the problem in redux

same issue. Is there any workaround?

axios 1.1.3 is the problem, downgrade to 0.27.2

no work for me. :-(

I have the same error , mine occurs when i install tweetnacl into my projects

Same error. Applied "patch" that changes "invariant(..." to "console.warn(..." and that solve the Error being thrown due to using deprecated 'ViewPropTypes', but then this error is keeping the app I am working on from running, and we have a physical /actual retail store that combines with the app for a cool shopping experience and this issue has just destroyed us.

Some kind of response from the team would be highly appreciated.
Screen Shot 2022-11-06 at 4 08 11 AM

Hi this issue appears to be affecting a lot of people, what is the best way to get support for it? It's unclear what is causing it, but I am receiving the same error as the previous posters.

 ERROR  Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
        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., js engine: hermes

Confirmed this issue was due to axios 1.1.3, reverted to 0.27.2 and yarn start --reset-cache, now it's good.

Here is a solution from Stack Over flow .... it's working for me ... I just upgraded to 0.75

https://stackoverflow.com/a/73135908/12460688

@longprao Thanks it's working good for me

The problem persists for me on 0.70.5.

TypeError: Cannot read property 'uid' of null, js engine: hermes
 ERROR  Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
        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., js engine: hermes```

Same error. Applied "patch" that changes "invariant(..." to "console.warn(..." and that solve the Error being thrown due to using deprecated 'ViewPropTypes', but then this error is keeping the app I am working on from running, and we have a physical /actual retail store that combines with the app for a cool shopping experience and this issue has just destroyed us.

Some kind of response from the team would be highly appreciated. Screen Shot 2022-11-06 at 4 08 11 AM

!UPDATE!

Was able to resolve by creating patch -- as recommended by @jayscottthomas -- but rather than returning just the type I also kept a warning message to remind myself and any other devs working on the project that this needs to be fixed.

The problem is exacerbated based on how many 3rd party dependencies needing to be updated to work with this new requirement. In example, our own project dependencies were relying on react-native-types, and the dependencies within those dependencies also rely upon the same react-native-types.

Though such a patch may not be recommended, for what it's worth it's actually a really great fix in that it just works, and it works pretty darn well. Once applied, my application ran without any gripes or issues.

Thanks, @jayscottthomas

What I implemented is below:

./ProjectRoot/patches/react-native+0.70.4.patch

diff --git a/node_modules/react-native/index.js b/node_modules/react-native/index.js
index d59ba34..9613fb0 100644
--- a/node_modules/react-native/index.js
+++ b/node_modules/react-native/index.js
@@ -435,32 +435,20 @@ module.exports = {
   },
   // Deprecated Prop Types
   get ColorPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'ColorPropType has been removed from React Native. Migrate to ' +
-        "ColorPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    console.warn('ColorPropType deprecated, yada yada yada')
+    return require('deprecated-react-native-prop-types').ColorPropType;
   },
   get EdgeInsetsPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'EdgeInsetsPropType has been removed from React Native. Migrate to ' +
-        "EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    console.warn('EdgeInsetsPropType deprecated, yada yada yada');
+    return require('deprecated-react-native-prop-types').EdgeInsetsPropType;
   },
   get PointPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'PointPropType has been removed from React Native. Migrate to ' +
-        "PointPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    console.warn('PointPropType deprecated, yada yada yada');
+    return require('deprecated-react-native-prop-types').PointPropType;
   },
   get ViewPropTypes(): $FlowFixMe {
-    invariant(
-      false,
-      'ViewPropTypes has been removed from React Native. Migrate to ' +
-        "ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
-    );
+    console.warn('ViewPropTypes deprecated, yada yada yada');
+    return require('deprecated-react-native-prop-types').ViewPropTypes;
   },
 };
 
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter. 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. at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:17 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:39 in handleError at node_modules/expo/build/errors/ExpoErrorManager.js:25:19 in errorHandler at node_modules/expo/build/errors/ExpoErrorManager.js:30:24 in <anonymous> at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError

Having same issue although upgraded to sdk 47.0.0 but still issue occurred.

Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
        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.
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:17 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:39 in handleError
at node_modules/expo/build/errors/ExpoErrorManager.js:25:19 in errorHandler
at node_modules/expo/build/errors/ExpoErrorManager.js:30:24 in <anonymous>
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError

Having this issue upgraded to sdk 47.0.0 of expo.Is there any solution ?

@karamanmertcan i have upgraded to sdk 47.0 and there's an issue with.
[ViewPropTypes will be removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types](https://stackoverflow.com/questions/71702392/viewproptypes-will-be-removed-from-react-native-migrate-to-viewproptypes-export)

so i couldn't moved forward even tried sdk 46 as well.

PLEASE suggest Solution for this

ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient.
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., js engine: hermes
undefined
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient.
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., js engine: hermes

I can't believe this is still a problem. And I don't see any solution around. What should we do about this?

I'm having the same issue here

still seeing this. did meta lay off the entire react-native QA team?

liro commented

"dependencies": { "@expo/vector-icons": "^13.0.0", "@react-native-async-storage/async-storage": "~1.17.3", "@react-native-firebase/analytics": "^16.4.3", "@react-native-firebase/app": "~15.4.0", "@react-native-picker/picker": "2.4.8", "@react-navigation/bottom-tabs": "^6.3.1", "@react-navigation/native": "^6.0.10", "@react-navigation/native-stack": "^6.6.2", "@sentry/react-native": "4.2.2", "@sideway/address": "^4.1.0", "axios": "^0.27.2", "base-64": "^1.0.0", "core-js": "^3.8.3", "dayjs": "^1.11.2", "expo": "^47.0.0", "expo-app-loading": "~2.1.1", "expo-apple-authentication": "~5.0.1", "expo-application": "~5.0.1", "expo-asset": "~8.6.2", "expo-auth-session": "^3.7.2", "expo-build-properties": "~0.4.0", "expo-clipboard": "~4.0.1", "expo-constants": "~14.0.2", "expo-dev-client": "~2.0.0", "expo-device": "~5.0.0", "expo-firebase-core": "~6.0.0", "expo-font": "~11.0.1", "expo-image-picker": "~14.0.1", "expo-linear-gradient": "~12.0.1", "expo-linking": "~3.2.3", "expo-notifications": "~0.17.0", "expo-random": "^13.0.0", "expo-status-bar": "^1.4.2", "expo-web-browser": "~12.0.0", "fbemitter": "^3.0.0", "fbjs": "^3.0.0", "fbjs-scripts": "^3.0.0", "firebase": "^9.9.2", "flow": "^0.2.3", "global": "^4.4.0", "isomorphic-fetch": "^3.0.0", "joi": "^17.3.0", "libphonenumber-js": "^1.10.13", "lodash": "^4.17.15", "mobx": "^6.5.0", "mobx-react": "^7.3.0", "moment": "^2.29.3", "node-fetch": "^2.6.1", "react": "18.1.0", "react-addons-shallow-compare": "^15.6.3", "react-dom": "18.1.0", "react-hook-form": "^7.34.0", "react-native": "0.70.5", "react-native-classnames": "^0.1.1", "react-native-cli": "^2.0.1", "react-native-gifted-chat": "^0.16.3", "react-native-picker-select": "^8.0.4", "react-native-reanimated": "^2.12.0", "react-native-safe-area-context": "4.4.1", "react-native-screens": "~3.18.0", "react-native-snap-carousel": "^3.9.1", "react-native-tab-view": "^2.16.0", "react-native-vector-icons": "^7.1.0", "sentry-expo": "~5.0.0" }, "devDependencies": { "@babel/core": "7.12.9", "@babel/plugin-proposal-class-properties": "^7.17.12", "@babel/preset-flow": "^7.9.0", "@types/react": "~18.0.24", "@types/react-native": "~0.70.6", "babel-preset-expo": "~9.2.1", "create-react-class": "^15.7.0", "flow-bin": "^0.123.0", "jest-expo": "^47.0.0", "prettier": "^2.7.1", "typescript": "^4.6.3" },

After expo sdk 47 update:

ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
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.

Hi, I was on 0.27.2, I upgraded to 1.1.3 (sorry for the typo in previous post) , without changing my code, I had the bug, I decreased back to 0.27.2, all was ok back after a yarn start --reset-cache . Do you want more infos, tests , code ?

In the same error, there is another part at the start - something like "ERROR TypeError: Restricted in strict mode, js engine: hermes". If this is the case, then the problem is due to axios. So downgrading axios fixes the issue. But the same error changes based on the package which is the source of the error and You'll have to find a solution on the basis of that error itself

I got the same error. I was adding Redux to my project, and kept getting the deprecation warning to use configureStore from @reduxjs/toolkit instead of createStore from redux. When I switched to configureStore from the toolkit, it leads to the error. But when using the depreceated createStore it compiles and seems to work just fine.

Currently working with react-native 0.70.5 , react-redux ^8.0.5 , redux ^4.2.0 , and @reduxjs/toolkit ^1.9.0

I got the same error.

Same error with a slight change after upgrading to 0.70.6. It says Cannot read property 'style' of undefined

ERROR  TypeError: Cannot read property 'style' of undefined, js engine: hermes

ERROR  Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.

       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., js engine: hermes
       
ERROR  Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.

       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., js engine: hermes

I had the same problem and realized my metro.config.js was invalid. I had to modify it during migration and forgot to remove a few parts. Fixing it solved the issue.

Same error ๐Ÿ˜ฆ

I also had this issue. My solution was changing 'main' in my package.json to the file where I was initializing AppRegistry. Hope this helps

For my issue related deprecated-react-native-prop-types.
After install deprecated-react-native-prop-types, and edit functions in the node_modules/react-native/index.js

`
get ColorPropType(): $FlowFixMe {
    console.warn('');
    return require('deprecated-react-native-prop-types').ColorPropType;
  },
  
  get EdgeInsetsPropType(): $FlowFixMe {
    console.warn('');
    return require('deprecated-react-native-prop-types').EdgeInsetsPropType;
  },
  
  get PointPropType(): $FlowFixMe {
    console.warn('');
    return require('deprecated-react-native-prop-types').PointPropType;
  },
  
  get ViewPropTypes(): $FlowFixMe {
    console.warn('');
    return require('deprecated-react-native-prop-types').ViewPropTypes;
  },
`

That working well

j1h00 commented

Same error with a slight change after upgrading to 0.70.6. It says Cannot read property 'style' of undefined

ERROR  TypeError: Cannot read property 'style' of undefined, js engine: hermes

ERROR  Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.

       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., js engine: hermes
       
ERROR  Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.

       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., js engine: hermes

same error for version 0.68.0

anyone solved this issue?
thanks

Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
        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.
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:17 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:39 in handleError
at node_modules/expo/build/errors/ExpoErrorManager.js:25:19 in errorHandler
at node_modules/expo/build/errors/ExpoErrorManager.js:30:24 in <anonymous>
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError

Having this issue upgraded to sdk 47.0.0 of expo.Is there any solution ?

Were you able to resolve this?

ERROR TypeError: Cannot read property 'style' of undefined, js engine: hermes
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
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., js engine: hermes
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
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., js engine: hermes

Anyone found any solution...please let me know...I m stuck on that error!

I had the same problem and realized my metro.config.js was invalid. I had to modify it during migration and forgot to remove a few parts. Fixing it solved the issue.

What did you update?

I don't know if it's relevant but I solved my problem by adding the 'react-native-reanimated/plugin' in the bable.config.js file and refreshing the app using npx expo start -c if your project is set up with expo.

module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: ['react-native-reanimated/plugin'],
  };
};

It appears to have been a conflict between react-native-firebase and firebase in my case

Removing kotlinVersion from my build.gradle and upgrading react-native-reanimated to @next version, works for me

I've noticed for me that this is happening when creating styles, specifically when re-exporting variables that've been imported from other files.

buttons.styles.ts

import { Spacing, Theme } from "./";

export const largeButton = {
    borderRadius: 52,
    paddingHorizontal: Spacing.x30, // these have been exported from a previous file, imported here and then exported again 
    paddingVertical: Spacing.x20, //   
    width: "auto"
}

Doing this causes:

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: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.

i have the same issue

any solution ?

yarn start --reset-cache solved for me.

This is works for me:

i'm using react-native-reanimated version 2.9.1

"react-native-reanimated": "^2.9.1"

and the solve is add "resolutions" on package.json

  "resolutions": {
    "react-native-reanimated": "^2.9.1"
  },

same issue this is anonnyinggg oh jesus help us

This is works for me:

i'm using react-native-reanimated version 2.9.1

"react-native-reanimated": "^2.9.1"

and the solve is add "resolutions" on package.json

  "resolutions": {
    "react-native-reanimated": "^2.9.1"
  },

sorry, it doesn't works

ReferenceError: Can't find variable: createMaterialTopTabNavigator
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
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: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
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.

In my case it was axios.

 ERROR  TypeError: Restricted in strict mode, js engine: hermes
Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient.
        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., js engine: hermes

Downgrading axios to 0.27.2 fixed it for me. Maybe it helps someone else.