Odd crash on Expo when minified and in production mode
See original GitHub issuePrior Issues
- https://stackoverflow.com/questions/73788057/react-native-project-crashing-with-redux-toolkit
- https://stackoverflow.com/questions/74283724/expo-crashes-with-redux-toolkit
- Also have a long discussion here https://forums.expo.dev/t/expo-go-with-react-redux-crashes-on-published-app-but-works-in-local/67949/8
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
import { configureStore } from "@reduxjs/toolkit";
export const store = configureStore({
reducer: {},
});
What is the expected behavior?
Not crash.
Environment Details
"@reduxjs/toolkit": "^1.9.0",
"react-redux": "^8.0.5",
"redux-persist": "^6.0.0",
"expo": "^47.0.6",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-native": "0.70.5",
Issue Analytics
- State:
- Created 10 months ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Expo Go with React-Redux crashes on published app but ...
I had the exact same issue. Expo crashed with just the import '@reduxjs/toolkit' and only in --no-dev --minify mode. --no-dev as well as...
Read more >Crash on android standalone app using Reanimated 2 with ...
App works fine in expo go app even in production mode with minify which should be equivalent to standalone apk. Only standalone apk...
Read more >Expo App works fine on development mode but crashes on ...
I run the app in prod mode without --minify arg (expo start --no-dev) and I was able to fix this issue. Debugging I...
Read more >A bug that made me a better developer. - LinkedIn
I reached out to Expo for advice and a new forum topic was created: My expo app is crashing in prod, how do...
Read more >Crash on start TestFlight | Apple Developer Forums
my expo app crash on TestFlight when call firebase API, but it works fine on expo go! so weird (no one answer question...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, that’s exactly my point.
Redux Toolkit, the
@reduxjs/toolkit
package, imports methods from theredux
core.That
isCrushed
check is in theredux/src/index.js
module file.It runs as soon as you import anything from the
redux
package.Therefore, yes, importing RTK triggers this crash because importing anything from
redux
runs that check.It’s not RTK that’s the issue. It’s the
redux
index file.@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?