React-redux: Unable to resolve "./utils/batch" from "node_modules/react-redux/lib/index.js"

Created on 19 Apr 2019  路  10Comments  路  Source: reduxjs/react-redux

"dependencies": { "axios": "^0.18.0", "drawer": "0.0.2", "expo": "^32.0.6", "prop-types": "^15.7.2", "react": "^16.8.6", "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz", "react-native-elements": "^1.1.0", "react-native-router-flux": "^4.0.6", "react-native-vector-icons": "^6.4.2", "react-redux": "^6.0.0", "react-saga": "^0.3.1", "react-thunk": "^1.0.0", "redux": "^4.0.1", "redux-saga": "^1.0.2" }, "devDependencies": { "babel-preset-expo": "^5.0.0", "react-native-reanimated": "^1.0.1", "schedule": "^0.4.0" },
This is my package dependencies but don't know why this message still appears, I spend 2 days trying to resolve it.
I deleted node_models folder, I uninstalled redux using npm uninstall, I re-installed every thing from scratch, I trying multiple version of react and redux but nothing.

Unable to resolve "./utils/batch" from "node_modules/react-redux/lib/index.js"

Most helpful comment

Appreciate the quick response! You were right about the mismatch. I was getting this issue with Expo caching different versions of react-redux. For others facing this with Expo, resetting the cache with expo r -c seemed to do it.

All 10 comments

Expo 32 doesn't support React 16.8, as far as I know.

Other than that, this is some kind of a build configuration issue and not a bug.

@aguerram were you able to fix this? Been getting the same issue since this morning.

The one thing I see in that list, actually, is that you've got react-redux : ^6.0.0 specified.

The batch() API was added in 7.0. So, you probably have a mismatch in React-Redux dependencies somewhere.

Appreciate the quick response! You were right about the mismatch. I was getting this issue with Expo caching different versions of react-redux. For others facing this with Expo, resetting the cache with expo r -c seemed to do it.

i got the same error, not using expo

"react": "^16.8.6",
"react-native": "^0.59.5",
"react-redux" : "6.0.1"

PS : I checked node_modulesreact-reduxpackage.json : "_id": "[email protected]",

any fix ?

@alainib it could be your version of React. Try:

"react": "16.5.0",

@ealemda2 !! You are a life saver. bless you!

"react": "16.5.0"

i still get this error with the following version :(

 "react-redux": "6.0.1",
 "react": "16.5.0",
 "react-native": "0.59.2"

the think that amaze me the most is even with the config i use since 2/3 weeks from your git i get same error now, not before
"react-redux": "6.0.1", react "16.8.6" , "react-native": "0.59.2"

it finally worked thank you

  • delete node_modules folder
  • package.json : "react": "16.8.3", "react-native": "0.59.2", "react-redux": "6.0.1"
  • npm install
  • live the node_modules\react-native\scripts\launchPackager.bat as it with node "%~dp0..\cli.js" start
  • change @react-native-community\cli\build\commands\runAndroid\runAndroid.js :

    const procConfig = { cwd: process.cwd() }

  • npm cache clean --force

  • npm start --clear-cache
  • react-native start --reset-cache
    AND THIS STEP I DIDNT DONE BEFORE
  • delete C:\Users\YOURUSERNAME\AppData\Local\Temp\metro-cache

I'm guessing that the caching issue with mismatching versions of react-redux exists for react-native as well and not just expo.

Was this page helpful?
0 / 5 - 0 ratings