question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Odd crash on Expo when minified and in production mode

See original GitHub issue

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

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:open
  • Created 10 months ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
markeriksoncommented, Nov 23, 2022

Yes, that’s exactly my point.

Redux Toolkit, the @reduxjs/toolkit package, imports methods from the redux core.

That isCrushed check is in the redux/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.

1reaction
markeriksoncommented, Nov 23, 2022

@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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found