Vscode: VS code shows incorrect latest version of a package in package.json

Created on 6 Oct 2020  路  5Comments  路  Source: microsoft/vscode

I noticed recently that VS code doesn't show the correct latest version of some packages on hover in package.json file.

For example, the latest version of @types/react-select is 3.0.21, but on hover, it shows up as 1.2.6 which is incorrect. I checked the version on both yarn pkg and npm registries. Both have the latest version.

This is in my local package.json file.

"devDependencies": {
    "@types/react-select": "^2.0.15", // Latest version is incorrectly shown for this package and some others
}

Please note that there are several other packages as well but that's irrelevant.

yarn.lock file entry

"@types/react-select@^2.0.15":
  version "2.0.19"
  resolved "https://registry.yarnpkg.com/@types/react-select/-/react-select-2.0.19.tgz#59a80ef81a4a5cb37f59970c53a4894d15065199"
  integrity sha512-5GGBO3npQ0G/poQmEn+kI3Vn3DoJ9WjRXCeGcpwLxd5rYmjYPH235lbYPX5aclXE2RqEXyFxd96oh0wYwPXYpg==
  dependencies:
    "@types/react" "*"
    "@types/react-dom" "*"
    "@types/react-transition-group" "*"

For some other packages like fork-ts-checker-webpack-plugin, it shows the correct latest version.
Is something broken after a recent update? Or is there something missing in my VS code configuration.
Please advice. Thanks!

upstream

Most helpful comment

Hovering over entries previously caused a "Loading..." tooltip, but I noticed that that doesn't happen anymore. I assume the entries are being cached somehow, but the cache is very inaccurate. This behavior either needs to be improved or I need to be able to revert to the old behavior. As it stands I have to manually check package versions on npmjs.com instead of just being able to hover, which is pretty annoying.

All 5 comments

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

Hovering over entries previously caused a "Loading..." tooltip, but I noticed that that doesn't happen anymore. I assume the entries are being cached somehow, but the cache is very inaccurate. This behavior either needs to be improved or I need to be able to revert to the old behavior. As it stands I have to manually check package versions on npmjs.com instead of just being able to hover, which is pretty annoying.

It seems api.npms.io is not up to date. I reported:
https://github.com/npms-io/npms/issues/42#issuecomment-707136902

If you have npm on your path, then we run npm view "@types/react-select" version" to evaluate the version.
If not, then we access api.npms.io:

@aeschli That issue has been open for several months now, but the problem in VS Code only started a week or so ago. Is it possible to get a setting that can be used to go back to whatever method was being used before this change? I would much rather have a "Loading..." indicator for a moment with correct results than incorrect results.

@vaindil Thanks, I found the problem. Created #108605.

Was this page helpful?
0 / 5 - 0 ratings