react-native-reanimated
react-native-reanimated copied to clipboard
Maximum call stack size exceeded (native stack depth) when loading from EAS Update
Description
Hi, I am running an Expo managed app with SDK 49, and Reanimated 3.3.0 After upgrading to SDK 49 (and to Reanimated 3.3.0 which goes with it), my app started crashing when loaded from an EAS update using the Expo Go app, while working fine locally (Both with Expo Go or in a development build).
While debugging the issue I noticed that it only happens while I still have some usage of reanimated. Once reanimated is out, the issue goes away.
On iOS it crashes completely, in Android in hangs on 'New update available, downloading...'
I have pulled the following errors from the iOS logs (similar error appears in Android logcat logs too):
Expo Go RangeError: Maximum call stack size exceeded (native stack depth), js engine: hermes Expo Go Invariant Violation: "main" has not been registered. This can happen if: Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project. A module failed to load due to an error and
AppRegistry.registerComponentwasn't called., js engine: hermes Expo Go NSInvalidArgumentException: -[EXReactAppExceptionHandler handleFatalJSExceptionWithMessage:stack:exceptionId:extraDataAsJSON:]: unrecognized selector sent to instance 0x281fa8380
Steps to reproduce
- Clone the minimal reproducible project
- Run
npm i - Run
npm startand see the project runs locally - use
eas updatecommand to make an update (you will probably have to change the configuration in app.json to match an Expo project you have access to, possibly a fresh one you created. See 'extra.eas.projectId' & 'updates.url' keys in app.json file) - Try to load that update using the Expo Go app
Snack or a link to a repository
https://github.com/sagihsh/expo-sdk-49-eas-update-crash-example
Reanimated version
3.3.0
React Native version
0.72.3
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
Expo managed workflow
Architecture
Paper (Old Architecture)
Build type
None
Device
Real device
Device model
iPhone 13 for iOS / Samsung Galaxy S8 for Android
Acknowledgements
Yes
I have the same error after upgrading to React Native 0.71. I used react-native-reanimated 2.14.4 and 3.4.2, doesn't seem to make any difference. To be fair I do not know if it is related to react-native-reanimated, I haven't been able to reproduce the issue myself but I am getting lots of reports for this same error.
Same issue here
Maybe related to https://github.com/expo/expo/issues/23382
I also face this issue in expo prebuild unless I run ./gradlew assembleRelease in android folder it work fine if I run yarn android --variant=release is crashed
Same for me, when using latest RN version + reanimated 3 it leads to crash with react-navigation/drawer
This randomly started happening to me out of nowhere does anybody have a workaround?
Update: This issue is confirmed to be fixed by upgrading to 3.6.0
https://github.com/expo/expo/issues/23382#issuecomment-1834527955
Hi @sagihsh. Does this error still occure in your case? I tried to reproduce it, but everything works for me. If so, does it still crashes with Expo SDK 50?
I am still having this crash with the updated version. Again, I'm not sure it comes from react-native-reanimated and my stacktrace is different.
I had this issue as soon as I upgraded to SDK 50 as well. I was able to find the root cause for my case if that's helpful for anyone else. My issue was in @expo/config-plugins with a Config object attempting to be destructured for an expoUsername property when it was undefined
I fixed this using npx patch-package, here is the patch:
diff --git a/node_modules/@expo/config-plugins/build/android/Updates.js b/node_modules/@expo/config-plugins/build/android/Updates.js
index 0c071b0..6f19aa7 100644
--- a/node_modules/@expo/config-plugins/build/android/Updates.js
+++ b/node_modules/@expo/config-plugins/build/android/Updates.js
@@ -89,7 +89,7 @@ exports.Config = Config;
})(Config || (exports.Config = Config = {}));
const withUpdates = (config, {
expoUsername
-}) => {
+} = {}) => {
return (0, _withPlugins().withPlugins)(config, [[withUpdatesManifest, {
expoUsername
}], withRuntimeVersionResource]);
diff --git a/node_modules/@expo/config-plugins/build/ios/Updates.js b/node_modules/@expo/config-plugins/build/ios/Updates.js
index 82deb1a..7c89031 100644
--- a/node_modules/@expo/config-plugins/build/ios/Updates.js
+++ b/node_modules/@expo/config-plugins/build/ios/Updates.js
@@ -62,7 +62,7 @@ exports.Config = Config;
})(Config || (exports.Config = Config = {}));
const withUpdates = (config, {
expoUsername
-}) => {
+} = {}) => {
return (0, _iosPlugins().withExpoPlist)(config, config => {
const projectRoot = config.modRequest.projectRoot;
const expoUpdatesPackageVersion = (0, _Updates().getExpoUpdatesPackageVersion)(projectRoot);
i have same when i install core-js & jwt-decode
i have same when i install core-js & jwt-decode
same here
I am facing the same issue. A lot of these error logs are printed in my console but only on Android both in debug and release mode, no such errors in iOS. The app works fine though, it never crashes. As @Pingou mentioned, I also started facing this issue after upgrading my RN version to RN 71.x. This strongly seems to be an issue related to Hermes on Android as mentioned here: https://github.com/handsontable/hyperformula/discussions/1286.
The error is also hard to debug as it does not get caught by any breakpoint and there are no stack traces, just this:
Unhandled promise rejection [RangeError: Maximum call stack size exceeded (native stack depth)]
Unhandled promise rejection [RangeError: Maximum call stack size exceeded (native stack depth)]
Unhandled promise rejection [RangeError: Maximum call stack size exceeded (native stack depth)]
Unhandled promise rejection [RangeError: Maximum call stack size exceeded (native stack depth)]
Unhandled promise rejection [RangeError: Maximum call stack size exceeded (native stack depth)]
@JJSLIoT My issue was that I was resetting the state in the parent component when the app went into foreground/background and also in the child component. Not sure why that was an issue but removing one of them fixed it for me.
The issue seems to have found a fix here. And the other reported things aren't connected to Reanimated whatsoever