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

TypeError: _reactRouter.createRoutes is not a function #29

Closed
kynetiv opened this issue Sep 10, 2015 · 3 comments
Closed

TypeError: _reactRouter.createRoutes is not a function #29

kynetiv opened this issue Sep 10, 2015 · 3 comments

Comments

@kynetiv
Copy link

kynetiv commented Sep 10, 2015

Forgive me if I'm just being new here ;-) I'm trying to follow along with Redux, React-Router 1-beta4, and your Next branch and its entirely possible I'm doing it wrong.

Issue I'm getting is the error in the title that's coming from reduxReactRouter.js and it may due to React-Router not exporting the createRoutes function? At any rate, I got past it by including React-Routers RouteUtils and using it like so:

/*... */

var _routeUtils = require('react-router/lib/RouteUtils');

/*...*/

var history = _reactRouter.useRoutes(createHistory)({
        routes: _routeUtils.createRoutes(routes),
        parseQueryString: parseQueryString,
        stringifyQuery: stringifyQuery
      });

Anyone else seeing this issue?

@ghost
Copy link

ghost commented Sep 11, 2015

Did you npm install --save react-router@git+https://github.com/acdlite/react-router.git#d8a41c86090ee661bc19b93c0a9169db510c46d8

There is a note on the next readme; this is what fixed that error for me.

You can probably just npm install --save react-router@git+https://github.com/rackt/react-router.git#master now that the pull request has been merged to master but I haven't tested it that way.

@kynetiv
Copy link
Author

kynetiv commented Sep 11, 2015

Thanks, that appears to have been it. Switched from beta4 release to the master branch at this time fixed it. Cheers!

EDIT- actually switched to acdlite react-router as react-router proper has build issues with webpack when installing from github, as seen here: petehunt/webpack-howto#30

@kynetiv kynetiv closed this as completed Sep 11, 2015
@sugandhgoyal
Copy link

I getting the same error as- WEBPACK_IMPORTED_MODULE_10_history_createBrowserHistory__.createHistory is not a function. I have "react": "^15.6.1", "react-router": "^4.1.1", "react-router-dom": "^4.1.1",
"react-router-redux": "^4.0.8". Please help me
I am not getting the solution anywhere.

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

2 participants