-
-
Notifications
You must be signed in to change notification settings - Fork 15.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
Odd crash on Expo when minified and in production mode #4443
Comments
For me to fix
I had to remove in lib/redux.js this block
As to why it would work without it, I am not sure, it does not look like it should have any side effects. However, this fix does not propagate to |
I'm kind of confused. The check you're pointing to is in the |
@timdorr @phryneas so tracing back the history of those lines, it dates back to this issue/PR in late 2015:
Worst case I think we'd be okay to remove that warning? |
I know I'm the one that originally merged this, but I think it's probably better to remove it. As we move towards ESM being more and more popular, relying on a Node-specific global is going to become less likely to be present and increase these kinds of issues. At least, that's my general sense of things. I have no data to back that up, so just take it as a hunch. |
Eh, I'm less worried about the |
The check I am poiting at is in |
@trajano : yes, I know, that's why I'm confused why you're saying this happens with RTK's |
Well a similar error occurs on RTK (just crash) but not l don't know what exactly is causing it. I am just pointing out that the patch I did on redux.js seems to fix createStore in redux. Maybe there's similar code in RTK, but by the time I can "see" it, the code is minified to an unreadable state already. |
Yeah, I understand that you're seeing this crash when you call But because this code is in the does this also crash if you just use because the "RTK" part shouldn't matter here. |
You mean
Yes it crashes unless I remove that |
If that check was removed, all versions would - this is really just the core implementation. |
you mean it would cause crashes on other places if that |
No. We're saying that there is only one place that check exists, in the In other words: This is not a "Redux Toolkit" problem. This is a "Redux core" problem. I'm going to go ahead and transfer this issue back to the core repo. |
Ah ok. Well the fix I did for for core that's for sure. So it may be a diffrerent one. However, let's see if we can clear off that check at least I'd have legacy redux as an option. However just having
with minified and process.env === PRODUCTION is enough to cause my app to crash with no useful traces that I can find. |
Yes, that's exactly my point. Redux Toolkit, the That It runs as soon as you import anything from the Therefore, yes, importing RTK triggers this crash because importing anything from It's not RTK that's the issue. It's the |
Hopefully that's all it is. Eagerly awaiting a release. |
Co-authored-by: Tim Dorr <[email protected]> Fixes #4443
Okay, this is finally out in https://github.com/reduxjs/redux/releases/tag/v4.2.1 . Sorry for the delay! |
Prior Issues
What is the current behavior?
The app crashes immediately. Note this does not occur if the app is not minimized or if in non-production.
Steps to Reproduce
I am unable to make a MVCE to show this.
But this can be recreated in my app https://github.com/trajano/spring-cloud-demo (it's not a trivial app, but to make it crash I when I add the following to https://github.com/trajano/spring-cloud-demo/blob/rework/expo-app/authenticated-context/AuthenticatedProvider.tsx
What is the expected behavior?
Not crash.
Environment Details
The text was updated successfully, but these errors were encountered: