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

Maximum call stack size exceeded (native stack depth) when loading from EAS Update #4921

Open
sagihsh opened this issue Aug 13, 2023 · 12 comments
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@sagihsh
Copy link

sagihsh commented Aug 13, 2023

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.registerComponent wasn't called., js engine: hermes
Expo Go NSInvalidArgumentException: -[EXReactAppExceptionHandler handleFatalJSExceptionWithMessage:stack:exceptionId:extraDataAsJSON:]: unrecognized selector sent to instance 0x281fa8380

Steps to reproduce

  1. Clone the minimal reproducible project
  2. Run npm i
  3. Run npm start and see the project runs locally
  4. use eas update command 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)
  5. 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

@sagihsh sagihsh added the Needs review Issue is ready to be reviewed by a maintainer label Aug 13, 2023
@github-actions github-actions bot added Repro provided A reproduction with a snippet of code, snack or repo is provided Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS labels Aug 13, 2023
@Pingou
Copy link

Pingou commented Aug 16, 2023

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.

@pohsiu
Copy link

pohsiu commented Sep 16, 2023

Same issue here

@mo6zes
Copy link

mo6zes commented Sep 24, 2023

Maybe related to expo/expo#23382

@chanphiromsok
Copy link

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

@T-Damer
Copy link

T-Damer commented Oct 5, 2023

Same for me, when using latest RN version + reanimated 3 it leads to crash with react-navigation/drawer

@pfcodes
Copy link

pfcodes commented Nov 24, 2023

This randomly started happening to me out of nowhere does anybody have a workaround?

@pfcodes
Copy link

pfcodes commented Dec 1, 2023

Update: This issue is confirmed to be fixed by upgrading to 3.6.0

expo/expo#23382 (comment)

@jfedak
Copy link
Contributor

jfedak commented Dec 15, 2023

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?

@jfedak jfedak added the Close when stale This issue is going to be closed when there is no activity for a while label Dec 15, 2023
@Pingou
Copy link

Pingou commented Dec 26, 2023

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.

@github-actions github-actions bot removed the Close when stale This issue is going to be closed when there is no activity for a while label Dec 26, 2023
@ladyshaitan
Copy link

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);

@sampadanaik
Copy link

i have same when i install core-js & jwt-decode

@ahsanbhatti98
Copy link

i have same when i install core-js & jwt-decode

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests