Argument of type History is not assignable to parameter of type History
queirozfcom opened this issue · 2 comments
queirozfcom commented
I've just cloned the repo and run npm install
and then npm start
and I got the following error message:
ERROR in [at-loader] src/server.tsx:57:40
TS2345: Argument of type 'History' is not assignable to parameter of type 'History'.
Types of property 'createLocation' are incompatible.
Type '{ (path?: LocationDescriptor, action?: string, key?: string): Location; (path?: string, state?: O...' is not assignable to type '(path?: LocationDescriptor, action?: Action, key?: string) => Location'.
Type 'Location' is not assignable to type 'Location'. Two different types with this name exist, but they are unrelated.
Types of property 'action' are incompatible.
Type 'string' is not assignable to type 'Action'.
The offending line looks like:
const history = syncHistoryWithStore(memoryHistory, store);
i'm a typescript noob but looking at the types here it looks like there are two History
types (with different versions) in scope, one coming from @types/react-router
(this one is version v2.0.0) and another one coming from @types/react-router-redux
(this one is version v3.2.0)....
glcheetham commented
@queirozfcom I'm having the same issue today why did you close this?
queirozfcom commented
@glcheetham Hi. I don't really remember but I think it was because the version on the dev branch had already fixed this, but I was using the version on the master branch