Closed ghost closed 4 years ago
TypeSync will use semver
to find the closest matching version.
Closing due to inactivity.
same happens with react-scroll
having
"react-scroll": "^1.8.1",
gives me
"@types/react-scroll": "^3.0.27",
which was an alpha version from 2016. Took 5 hours of my life to figure it out because I was getting very weird errors having anything but pointing me in the right direction.
After correcting the version all works properly.
@genesiscz
I believe the reason for the issue is because the maintainers of the types for react-scroll
neglected to mark the version you specified - 3.0.27
- with the -alpha
suffix. Typesync thus sees 3.0.27 to be the best matching types version for the code package version you have installed. This is a consistency error on the part of the maintainers of the types package when it comes to publishing.
Yea, I know why it happened, it is a dumb inconsistency error, the point is typesync shouldn't probably match versions two major lvl higher than it is stated in the package.json. 1.8.1 -> 2.0 is wrong, 1.8.1 -> 3.0.27 is even more wrong. Wouldn't it be a better idea to just skip these? It could save a lot of time for future visitors :-)
Anyway thanks a lot for this one, it could have saved me a lot of time! :)
For instance, when I had a dependency of
"bcrypt": "^3.0.7"
- it gave me"@types/bcrypt": "^10.0.28-alpha"
which is 3 years old. The latest version of@types/bcrypt
is actually3.0.0
.