react-router + history = error

Created on 8 Sep 2017  路  4Comments  路  Source: ReactTraining/react-router

Hi there! I've checked everywhere and don't know how to solve my issue.
"react-router-dom": "^4.2.2",
"history": "^4.7.2",

history.js

import createBrowserHistory from 'history/createBrowserHistory'

const history = createBrowserHistory()
export default history

index.js

import history from './history'
import { Router } from 'react-router-dom'

<AppContainer>
  <Router history={history}>
    <Provider store={store}>
      <Component />
    </Provider>
  </Router>
</AppContainer>,

And in app have errors:
./~/react-router/es/Redirect.js
42:17-31 'history' does not contain an export named 'createLocation'.

./~/react-router/es/Redirect.js
45:8-25 'history' does not contain an export named 'locationsAreEqual'.

when I made console.log(history), I'm receiving next object:
capture image

Most helpful comment

Hey, guys! Sorry for that late response. My problem was in Webpack config in resolve modules section. I put at first place node_modules and problem gone

All 4 comments

Found the problem in webpack config! thx

@RoyalHunt Care to shed some light as to what the error was in your Webpack config? I seem to be running into the same issue.

@sandersky any luck on this one? Having the same issue here

Hey, guys! Sorry for that late response. My problem was in Webpack config in resolve modules section. I put at first place node_modules and problem gone

Was this page helpful?
0 / 5 - 0 ratings

Related issues

imWildCat picture imWildCat  路  3Comments

nicolashery picture nicolashery  路  3Comments

ackvf picture ackvf  路  3Comments

alexyaseen picture alexyaseen  路  3Comments

sarbbottam picture sarbbottam  路  3Comments