redux: Odd crash on Expo when minified and in production mode

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",

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Okay, this is finally out in https://github.com/reduxjs/redux/releases/tag/v4.2.1 . Sorry for the delay!

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

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.