biome-vscode: š Extension does not find the biome binary if it depends on the CWD
VS Code version
1.96.2
Extension version
2.3.2
Biome version
1.9.4
Operating system
- Windows
- macOS
- Linux
Description
Our project is managing the version of Biome through mise. This means, that the biome version is specified per project. This means, that biome is not available when running from the home folder but from the project folder:
# From ~:
⯠which biome
biome not found
# From the project
⯠which biome
~/.local/share/mise/installs/biome/1.9.5-nightly.ff02a0b/biome
The extension is not able to recognize this properly and instead it reports that the biome binary could not be found. With the latest pre-release it does not even warn the user about the fact that biome is missing.
Note, that this works as expected if VSCode ist started from the project folder from the terminal (where biome is available).
Steps to reproduce
- Use
miseto install biome per folder - Start VSCode from outside that folder (e.g. through Launchpad)
Expected behavior
The extension should be able to find the biome binary based on the path itās operating in.
Does this issue occur when using the CLI directly?
No
Link to a minimal reproduction
No response
Logs
2025-03-13 12:02:00.557 [info]
2025-03-13 12:02:00.557 [info] Biome extension 2025.2.72227 activated
2025-03-13 12:02:06.397 [error] Could not find the Biome binary
2025-03-13 12:02:06.397 [error] Failed to create session for project.
project=<REDACTED>
2025-03-13 12:02:06.397 [info] Biome extension started
2025-03-13 12:02:06.398 [info] User-facing commands registered
2025-03-13 12:02:06.398 [info] Started listening for lockfile changes
2025-03-13 12:02:06.398 [info] Started listening for configuration changes
2025-03-13 12:02:06.398 [info] Started listening for active text editor changes
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 18 (7 by maintainers)
The
findBiomeInPathmethod was never intended to be workspace-aware. Itās meant to locate a globally installed Biome instance on your system. The reason we call it infindBiomeForWorkspaceFolderis to gracefully fallback to that global installation in the event we donāt find one installed in your dev deps.This wouldnāt work for versions prior to Biome v2, because thatās when we introduced this command, but we could introduce some logic to check for that and use the current behavior in that case.
That said, Iām yet to understand how
miseworks under the hood.As mentioned before, if someone is willing to send a PR that adds support for this without breaking the existing logic, Iām all for it.
@nhedger @ematipico To come back to the
misequestion. Why not to obtain the binary path by executingwhich biomewith cwd set to current workspace root. That can be a fall back check, for instance. This could work, or? As explained in https://github.com/biomejs/biome-vscode/issues/528#issuecomment-2836039336ok. it turns out the doc is super misleading for windows situation as it implies downloading the published binary, including manually looking up the latest CLI version, and yet adding it into the sysyem env variable after downloadingā¦
the fix is just running:
npm install -g @biomejs/biome@latsetfrom anywhere in the cli.The annoying install biome globally notification is finally resolved!