acdlite / redux-router

Redux bindings for React Router – keep your router state inside your Redux store
MIT License
2.3k stars 200 forks source link

Module not found: Error: Cannot resolve module 'redux-router' in ... #163

Closed bd closed 8 years ago

bd commented 8 years ago

Probably a newb issue but:

I get Module not found: Error: Cannot resolve module 'redux-router' in ... in my configureStore.js from the line import { reduxReactRouter } from 'redux-router'; despite the fact that I ran $ npm install --save redux-router@1.0.0-beta4 and see redux-router in package.json for my webpack build. The module appears to be in the node_modules directory of my application.

So I'm a bit at a loss of why the redux-router module is not available.

Scarysize commented 8 years ago

@bd Do you get this error while bundle with browserify/webpack?

bd commented 8 years ago

No, this shows up in the Chrome console on page load.

Scarysize commented 8 years ago

What loader do you use in webpack?

bd commented 8 years ago
module: {
    loaders: [
      { test: /\.js$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/ },
      { test: /\.css$/, loader: ExtractTextPlugin.extract('css-loader?module!cssnext-loader') }
    ]
  },
  resolve: {
    extensions: ['', '.js', '.json']
  }

the app was sketched out via $ yo redux, so that's starting point

And my .babelrc file is

{
  "stage": 0
}
bd commented 8 years ago

The issue was entirely my error--had a misplaced bracket in an unrelated area that must have been crashing the build elsewhere

omnidan commented 8 years ago

@bd glad you figured it out :wink:

jontelm commented 8 years ago

"npm install redux-router" gave me a empty package, "npm install --save redux-router@1.0.0-beta4" works.

bd commented 8 years ago

I did not mention that, but I did make that change earlier. It did not resolve the issue, which was caused by some mistake entirely on my end--misplaced braces, IIRC, but unfortunately not surfaced until I got to the router code expecting some type that it did not receive.

On Fri, Nov 13, 2015 at 3:42 AM Jonatan Lundqvist notifications@github.com wrote:

"npm install redux-router" gave me a empty package, "npm install --save redux-router@1.0.0-beta4" works.

— Reply to this email directly or view it on GitHub https://github.com/rackt/redux-router/issues/163#issuecomment-156405836.