Skip to content

fix(lsp): biome bunx fallback runs the unrelated biome npm package instead of @biomejs/biome #133

Closed

Description

@amondnet

Problem

When neither node_modules/.bin/biome nor a biome on PATH is found, BiomeServer.spawn falls back to:

spawn('bunx', ['biome', 'lsp-proxy', '--stdio'], …)

(packages/lsp/src/server/biome.ts:75)

bunx biome resolves the npm package named biome. That is not Biome. Biome is published as @biomejs/biome. The unscoped biome package is an unrelated project ("A simple way to manage environment variables on a per-project basis", latest 0.3.3), and it also ships a biome bin:

Package Latest bin
biome 0.3.3 biome: ./dist/index.js
@biomejs/biome 2.6.2 biome: bin/biome

So on a machine without Biome installed, the fallback downloads and runs an unrelated third-party package with lsp-proxy --stdio. The Biome language server never starts. Instead, the LSP client gets a process that does not speak LSP. The warning in the catch block already says the right package (npm install @biomejs/biome), but the spawn itself uses the wrong one.

Expected

The fallback runs the real Biome CLI. For example:

spawn('bunx', ['@biomejs/biome@<version>', 'lsp-proxy', '--stdio'], …)

Pin the version, the way the TypeScript fallback pins typescript-language-server@4.3.3 since #131. That keeps the fallback reproducible, and stops it from reusing whatever the bare name resolves to.

Notes

  • spawn from node:child_process reports a missing command through the async error event; it does not throw synchronously. So the catch around the bunx fallback, and its install hint, effectively never run. The fix may want to log the hint some other way.
  • The real-package resolution could be covered by a test like the classic-fallback tests added in fix(lsp): skip an unrunnable typescript-language-server and fall back to bunx #131 (packages/lsp/test/unit/server.test.ts). Those tests put a recording bunx on PATH and assert its arguments.

Found while working on #127 / #131.

Activity

  1. added theissue type on Oct 22, 2026
  2. added a commit that references this issue on Oct 22, 2026
    5d53def
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lsptype:bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions