5

I'm trying to use connected-react-router module.

From the docs, this is my code in the reducer:

import { combineReducers } from 'redux';
import login from './loginReducer';
import { connectRouter } from 'connected-react-router'

export default (history) => combineReducers({
  router: connectRouter(history),
  login
});

I'm getting this error in compilation time:

./node_modules/connected-react-router/esm/ConnectedRouter.js Module not found: Can't resolve 'react-redux' in 'C:\Users\ericn\Documents\ReactJS\test\node_modules\connected-react-router\esm'

I've been looking for this for a while but none seems to have the same problem.

Any thoughts?

1
  • Where are you importing something from react-redux? Commented May 20, 2019 at 22:02

1 Answer 1

6

I recently experience a similar error. What I realized was that I forgot to add react-redux as a dependency to my project, I only added react.

So confirm that you have react-redux in your package.json and it is installed in your node_modules. If not you can run:

npm install --save react-redux

// or if you are using yarn
yarn add react-redux
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.