Skip to content
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

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

Closed
aguerram opened this issue Apr 19, 2019 · 10 comments
Closed

Comments

@aguerram
Copy link

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

@markerikson
Copy link
Contributor

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.

@ealemda2
Copy link

ealemda2 commented Apr 19, 2019

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

@markerikson
Copy link
Contributor

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.

@ealemda2
Copy link

ealemda2 commented Apr 19, 2019

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.

@alainib
Copy link

alainib commented Apr 25, 2019

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_modules\react-redux\package.json : "_id": "react-redux@6.0.1",

any fix ?

@oddnavy
Copy link

oddnavy commented Apr 26, 2019

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

"react": "16.5.0",

@Ejyption
Copy link

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

@alainib
Copy link

alainib commented Apr 26, 2019

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

@alainib
Copy link

alainib commented Apr 26, 2019

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

@ealemda2
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants