biome-vscode: 🐛 Biome not detected in dependencies

VS Code version

1.91.1

Extension version

2.3.0

Biome version

1.8.3

Operating system

  • Windows
  • macOS
  • Linux

Description

I see this popup, and don’t get any linting from Biome, even though I have Biome in my project’s devDependencies in package.json

image

Steps to reproduce

  1. Add "@biomejs/biome": "1.8.3", to devDependencies
  2. Install the Biome extension
  3. Reload the window

Expected behavior

Biome should detect that it’s installed from package.json

Does this issue occur when using the CLI directly?

Yes

Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 9
  • Comments: 33 (26 by maintainers)

Most upvoted comments

Same problem in a yarn 3.2.2 monorepo. In the root package.json is a devDependency for @biomejs/biome v1.9.4

But I always get the message Could not find Biome in your dependencies. Either add the @biomejs/biome package to your dependencies, or download the Biome binary.

Formatter does not work after I click OK. At the moment only the biome cli is working for me.

I am confused. Is this a bug?, Did I miss something? Or will this only work after https://github.com/biomejs/biome/issues/2228 is implemented?

hello guys, any1 got a fix for this?

Ah, this might have been poor communication on my part. This command does not actually clear the downloaded versions, but we cache the request that retrieves the list of available versions from GitHub to avoid hitting the rate limit. This command is used to reset this cache.

To clear this “bundled” version, you need to delete the following folder manually:

~/Library/Application Support/Code/User/globalStorage/biomejs.biome/server

We’ll make sure to add a command that does this in the next version.

I’m trying to make a repro for this because it’s really irritating.

I realised that in this instance, it was in fact not the extension specifically, but that biome was indeed not properly installed.

I think that what happened was that when merging changes that involve changes to package-lock.json, I removed it and recreated it by running npm i again and committing that version - but this has a different result than the original npm install --save-dev --save-exact @biomejs/biome… Having re-run that, it seems to be improved.

The above also worked for me - but I find it less than ideal that this necessary. I don’t think there’s anything particularly complex about my project from a biome perspective (using npm, not a monorepo…)

Happy to try and reproduce it if you can provide a minimal reproduction repo with these settings.

Also, FWIW, I’m not seeing the Biome 1.8.3 anymore. This just spins forever. image

Thanks @nhedger. I assume you meant pre-release, as “nightly” is deprecated. image After switching to pre-release, I have a different popup, but I’m still missing Biome. I expect to have it because it’s in my package.json and I’ve run npm i. Could the problem be that it’s a monorepo and package.json isn’t in the root folder? image

Hey, sorry I sometimes use the terms interchangeably since we deprecated the actual nightly version, but you’re correct I meant the pre-release.

As for the extension not detecting Biome, I believe it is indeed because you’re in a monorepo. The extension will try to find Biome at in the Project, which happens to be the root of your workspace folder by default. You can explicitly declare projects with the biome.projects setting.

Try adding the following to your ${workspaceFolder}/.vscode/settings.json file:

{
    "biome.projects": [
        { "path": "/path/to/the/subfolder" }
    ]
}

@ematipico, I still have this “bundled” thing showing after clearing versions cache. My teammate is also getting the constant popup warning as well.

image