Closed sad1y closed 7 years ago
No thats not normal and i noticed it as well today when generating a new template after having updated yo & aspnetcore-spa generator.
I tried copying my old node_modules from a week old project (same package file), replacing the ones downloaded in the new project and the errors disappeared.
I've also run into this. I had to make the following adjustments to my package.json to get things working again:
"@types/react-router": "2.0.42",
"@types/react-router-redux": "4.0.36",
"@types/history": "2.0.44",
I'm looking into it now, previously react-router-redux had some typings
issues in it's declaration files. https://github.com/DefinitelyTyped/DefinitelyTyped/issues/10686#event-921092256, which then the fixes got merged in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/13642 a few days ago.
The template is using "@types/react-router-redux": "^4.0.30"
, with ^
so it picks up the latest version.
So the History
(@types/history
) definition files had some serious updates recently: you can see them in this commit, https://github.com/DefinitelyTyped/DefinitelyTyped/commit/a1abf4fd44d411c689300f1c9fa99dc83e4de091
So although the react-redux-router types fixes would have helped, the 2 are now colliding.
@SapientGuardian is correct in that the types should be pinned for now.
Just made a PR for it here #586
Hmm, just wondering if the the problem is in @types/react-router-redux or @types/react-router?
$ npm install @types/react-router-redux
`-- @types/react-router-redux@4.0.38
+-- @types/history@2.0.45
+-- @types/react-router@2.0.44
| `-- @types/react@15.0.0
`-- redux@3.6.0
+-- lodash@4.17.4
+-- lodash-es@4.17.4
+-- loose-envify@1.3.1
| `-- js-tokens@3.0.0
`-- symbol-observable@1.0.4
...got @types/history@2.0.45 as expected
$ npm install @types/react-router
`-- @types/react-router@2.0.44
+-- @types/history@4.5.0
`-- @types/react@15.0.0
...got @types/history@4.5.0, expected @types/history@2.0.45
Also noticed the following in the package.json
for @types/react-router...
"version": "2.0.44",
"dependencies":
{
"@types/history": "*",
"@types/react": "*"
}, ...
Could another way to fix be to set "@types/history": "~2.0.44"
instead?
Where are these dependent versions set for @types?
Yup I have the same issue, seems to be installing version 4.x.x, fixed temporarily on my end by adding
"@types/history": "^2.0.44"
to my own dependency list.
Thanks for reporting this. Fixed in f8714e9.
@olafurw Thanks!
Anytime Chuck Norris.
@SteveSandersonMS
Quick question - will the published Yo generator be updated shortly with this fix, or do I have to be a bit more patient? ;) (Updated my copy just now but problem persists).
Edit:
Just copied the changed files from your commit f8714e9 into the relevant locations (on windows):
C:\Users\{Username}\AppData\Roaming\npm\node_modules\generator-aspnetcore-spa\app\templates\
All working - very happy 👍
It is normal that this happens?