-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[android][release] makeShareableCloneRecursive Call Stack Size Exceeded #4690
Comments
@tomekzaw this is still an issue for my team. Could we get some advisory on whether the workaround above is viable, and why it might be happening? |
Hey @thespacemanatee, thanks for reporting this issue, investigating the root cause as well as providing the workaround.
Sure, we will investigate this issue once we finish investigating other issues that we're looking into right now. |
Just documenting here that something about the react native setup on Android isn't idempotent, the issue has been spuriously occuring in the past week since updating to Expo 49 and RN 0.72. One thing that helped was clearing |
same issue +1, I hope it will be resolved soon |
I'm getting a similar issue on android in release mode, in development everything works fine. |
This issue is also blocking our release right now. The crash only occurs in release mode (--variant Release) and works fine in dev mode. |
Hey @hirbod, thanks for reporting this. We suspect that the root cause of the issue is using dev bundle with release build. Can you please confirm that worklets in your release bundle don't contain In the meantime, @piaskowyk is working on a PR that will throw a more descriptive error in such case. |
@tomekzaw can you give me some directions how/where I should look for |
@hirbod Sure! Are you able to extract the JS bundle file from your app? If not, I'll think of some different way on how to check this. |
@tomekzaw, the only thing that might support your guess is that I can see the Expo CLI outputs I need to do some quick research on how to dump the release bundle, never did that before. |
@tomekzaw, I cd'd into So it appears your guess was correct. Could it be some kind of strange caching issue? |
@hirbod You can also add something like |
Yep, might be. That's why we'll add an additional runtime check on Reanimated side. |
Maybe the recent changes to Metro and Expos ability to load .env files are the reason here. Seems like --variant Release is still loading .env.development instead of .env.production. So this means, between every local change from development -> production, we need to run |
@tomekzaw the issue occurs again now and then and doesn't seem to have a deterministic solution, @hirbod could you confirm if it works every time and on different machines? I also think it's weird that this issue only happens to Android. If it is what the team says it is, that the Android build cache needs to be cleared, then why does the solution in #4737 suggest fixes in the JS-land (solution 2)? And why does this affect Android only and not iOS as well? More investigations need to be done to find the root cause. |
@thespacemanatee I did not test on a different machine but it was working for my mate and on EAS. I also had the suspicion that --variant Release vs --variant release (lowercase) might have been the root cause to the issue. After using EXPO_NO_DOTENV=1 with lowercase "release" I did not run into this issue anymore so far. Something is not cleared up correctly while switching between dev and release on the same machine. |
@hirbod the variant casing should depend on the build flavours that you defined in |
I haven't defined any build flavours, and have been using the defaults provided by Expo. I figured out that using an uppercase 'R' was causing some issues for me. For example, it generated a production app, but loaded a development bundle. I'm not certain if this was merely a coincidence or not, but something seems off since the introduction of SDK 49 (and it's ability to read our local DOTENV / NODE_ENV). Maybe we need to be more verbose now passing |
@hirbod @thespacemanatee I think I found something. This is how we detect dev/release bundle in Reanimated Babel plugin: react-native-reanimated/plugin/src/utils.ts Lines 1 to 6 in 5d4e02e
If you pass |
## Summary Fixes: #4690 It may happen when one of the user dependencies provided transpiled code with debug version of the Reanimated plugin. In effect, we have a debug version of the work in your release bundle. This might lead to unexpected issues or errors. 😢 I created issue with description how to fix this issue: #4737 --------- Co-authored-by: Tomek Zawadzki <tomasz.zawadzki@swmansion.com>
@tomekzaw this matches exactly my issue. So the uppercase R was the main problem for me. I retried couple of times and could reproduce this reliable. |
@tomekzaw @hirbod If my variant is |
@thespacemanatee I've never seen your syntax. I would assume that both of your commands would generate a dev bundle. I might be wrong, but I am only aware of
|
@hirbod please read about multiple build variants here: https://docs.expo.dev/build-reference/variants/ The syntax I provided is correct. Internally it transformed the variant to I might also add that this has been working since SDK 45 and probably before that as well. Are you sure it's not 'officially' supported? Any source? |
I don't see any indication that your syntax is correct. Only EAS commands should include Here is a link for reference: https://docs.expo.dev/build-reference/troubleshooting/#verify-that-your-project-builds-and-runs-locally The only "official" guidance I have is a direct message from @EvanBacon, who figured I passed an uppercase 'R' for android (instead iOS). Perhaps he can provide further clarification. For me, it fixed the issues. |
@hirbod I've seen that documentation. If you try creating multiple build variants you'll realise that the |
@hirbod sorry I was typing on my phone. This is very helpful, thanks. There isn't really any documentation about configuring |
Yes you can try NODE_ENV=production npx expo run:android.... |
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> ## Summary This PR changes the way how Reanimated Babel plugin detects if dev or prod bundle should generated. Previously, we would only support `BABEL_ENV=production` and `BABEL_ENV=release`; all other options would fallback to dev bundle. Thanks to this change we will also support other configurations e.g. `productionRelease` or `staging`. See #4690 for details. ## Test plan <!-- Provide a minimal but complete code snippet that can be used to test out this change along with instructions how to run it and a description of the expected behavior. -->
Description
I'll start by saying that I've spent many days on this and already looked at #4140, #4177, #4367 and #4475, and this is a separate issue. I also created an issue at expo/expo#23297 but I don't think it's expo's fault because I could not reproduce this on their bare template. It's worth noting that this does not occur on
react-native@0.71
orexpo@48
.The bug, for me, only occurs on the Android
release
build or thedebug
build with theJS Dev Mode
disabled.This gave me the idea to search for all
__DEV__
flags within the installed version in mynode_modules
and flip all of them so that I can see the error in dev mode and get a nicer stacktrace. Here's what I got:This narrows down the problem quite well, and I found that the following patch solves my issue:
Obviously, this is not ideal and doesn't seem like the official solution (why would stackDetails have anything to do with the fix?), so I'm hoping the team will have a better idea. Thanks for the great work!
Steps to reproduce
I could not reproduce this on the bare expo template, but I'm linking it anyway. I hope the patch I provided above will give some clue as to why it only happens on some projects.
react-native-reanimated@3.3.0
npx pod-install
import 'react-native-reanimated'
inApp.tsx
is enough to trigger the bugSnack or a link to a repository
https://github.com/thespacemanatee/expo-dev-menu-repro/tree/repro/reanimated-makeShareableCloneRecursive-crash
Reanimated version
3.3.0
React Native version
0.72.1
Platforms
Android
JavaScript runtime
Hermes
Workflow
Expo bare workflow
Architecture
Paper (Old Architecture)
Build type
Release mode
Device
Android emulator
Device model
Pixel 7 Pro (Android 13) and Pixel 3a (Android 10)
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: