-
Notifications
You must be signed in to change notification settings - Fork 24.2k
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: Failed to call into JavaScript module method AppRegistry.runApplication(). When Upgrading To React Native v0.70 #34688
Comments
i have the same issue |
i have the same issue too |
+1 |
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 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: The error you have above is incomplete, you're missing this important part:
|
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 my package.json:
|
my colleague @lirazhad was able to fix it by applying this patch package on react-native 0.70.0 itself!
|
any update? same issue |
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. 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!] |
Now after wasting so much time, I have to downgrade to 0.68 |
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 |
npm install ***@***.*** use this
…On Thu, Sep 22, 2022, 6:49 PM marcodiloreto ***@***.***> wrote:
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
—
Reply to this email directly, view it on GitHub
<#34688 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APULPG4ITCIBB7WFZAHXRKTV7RMFTANCNFSM6AAAAAAQMLU6CI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
what do you mean @... react-native@0.69.5? do you usually just run npm install react-native@..** and it downgrades without dependency collision? |
@marcodiloreto Then:
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 encountered a similar challenge within a monorepo, where I faced an issue with expo-sentry. This particular package relies on @sentry/react as a dependency. As we proceeded to update our sentry packages in our web application's our mobile app started throwing this error. We resolved the issue by installing @sentry/integrations, @sentry/react, and @sentry/tracing as additional dependencies into the mobile app at their expected versions. |
for me this ERROR ReferenceError: Can't find variable: connect
npmPackages: not able to fix |
I have this problem. RN version 0.70.10 |
@Kpangaa Try this to see if the log displays better #34688 (comment) |
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days. |
Anyone found a fix ? |
In my particular use-case the "culprit" was the I am posting this because I have not read a similar case in any other comment. Essentially there are two solutions:
You may want to keep as a reference this comment. It is very enlightening. |
In my case, it was also the
And as recommended by @ikotsov, you can use patch-package if you want to avoid forking the library for no particular reason |
This StackOverflow answer fixed the error for me: https://stackoverflow.com/a/73135908/9577215 I can recommend doing the steps outlined in this github discussion. Steps
to this:
|
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days. |
1 similar comment
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days. |
Seeing this error in my console as well. Is there any better fix than hacking the node_modules or downgrading ReactNative? using RN 0.72.6 |
Did the error occur when upgrading to RN 0.72.6? If you come from a version previous to 0.7x.x you must check which dependency is incompatible with the new version of react native. Applying this setting helped me to visualize which dependencies were causing the error. Once you fix the errors you can restore the file you edited in node_modules (this change is just to make it more visible what is going wrong) I hope it helps! |
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days. |
This issue was closed because the author hasn't provided the requested feedback after 7 days. |
Hi @efstathiosntonas, |
I faced the same issue when upgrading
I resolved the issue by searching for
I added an
Then, I removed This resolved the issue after re-running the metro server and re-installing the app. This is a temporary solution as we are modifying the sub-dependencies of our dependencies which may lead to unexpected behavior. The correct solution is to upgrade the affected dependency itself. |
i'm also facing the same issue :( |
+1 |
expo upgrade worked for me |
|
it's not worked for me |
Still waiting for 1.0 release without that pretty debugger) |
Hey everyone! After 3 days, I found a solution for this bug in my case. It was being caused by ViewPropTypes, that dont exist anymore on 'react-native' package. We have to import it from 'deprecated-react-native-prop-types'. I was was not getting to find what dependency was using this prop, but I found out that ir wasn't found due to a specific VS Code configuration. You guys should click on this Icon, to disable this option, that hide the term ocurrences on some directories inside node_modules. After clicking on it, you will be able to locate where this prop are being used, and fix the bug, like I did below: . To persist this change, you can take a look on patch-package repo: |
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
The text was updated successfully, but these errors were encountered: