Closed luandro closed 8 years ago
@luandro can you post a gist with the code that produces this error? :grin:
I can't get client to match server btw... checksum is always invalid
@luandro thanks! would be great if you could put it in a repo instead so it's easy to reproduce :sweat_smile: I didn't think it'd be that much :stuck_out_tongue:
@omnidan here's a repo.
git clone -b next https://github.com/luandro/hapi-universal-redux.git
cd hapi-universal-redux
npm install
npm run dev # to start node server and hot server
npm i redux-router@1.0.0-beta4 # install beta-4 to see the error
npm run dev
Actually I just cloned my own repo, and I get the error even with beta3. I'll close this for now and investigate further.
@luandro hope you figure it out, feel free to open a new issue if it turns out to be redux-router related :smile:
This was caused when I didn't pass in a createHistory
function to reduxReactRouter
.
To fix it:
const store = reduxReactRouter({routes, createHistory})(createStore)(rootReducer, initialState);
The lack of a createHistory
function should probably throw an error both in reduxReactRouter
as well as in the history
package if there is no createHistory
param passed in (can make a PR if needed, but given the PR backlog, I don't know if it's worth it)
Stack trace:
at Object.createLocation (/Users/mk/Code/kanbanReactStarter/node_modules/history/lib/useQueries.js:99:45)
at /Users/mk/Code/kanbanReactStarter/node_modules/redux-router/lib/server.js:52:40
at /Users/mk/Code/kanbanReactStarter/node_modules/redux-router/lib/matchMiddleware.js:21:13
at /Users/mk/Code/kanbanReactStarter/node_modules/redux-router/lib/matchMiddleware.js:27:13
at Object.dispatch (/Users/mk/Code/kanbanReactStarter/node_modules/redux-router/lib/replaceRoutesMiddleware.js:15:16)
at /Users/mk/Code/kanbanReactStarter/build/webpack:/src/server/server.js:51:9
react-router
will throw you an error as far as I can see.
Will give me:
Uncaught TypeError: createHistory is not a function
react-router@1.0.0-rc3
@mattkrick what is your react-router version. Could you test if this is still a issue for you?
I just checked again, still doesn't throw, react-router
isn't part of the stack trace.
"react-router": "^1.0.0-rc3",
"redux-router": "^1.0.0-beta4",
Can you throw together a gist or give me repo to reproduce the error?
Sure thing: https://gist.github.com/mattkrick/08dff8474882f01993fb
After line 3 it shouldn't matter since it breaks at creating the store
Got this error on Beta4, it's gone when reverted back to Beta3.