biome-vscode: 🐛 Error when running format: Extension 'Biome' is configured as formatter but it cannot format 'TypeScript JSX'-files

VS Code version

1.92.1

Extension version

v2024.5.251958

Biome version

1.8.3

Operating system

  • Windows
  • macOS
  • Linux

Description

I installed the Biome extension according to the docs as well as Biome itself (yarn add -D @biomejs/biome). I tried this both with the latest stable and pre-release extension version. The CLI works fine but I cannot get the extension to work.

My VSCode settings:

  "[javascript][javascriptreact][typescript][typescriptreact][json][jsonc]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
      "quickfix.biome": "explicit",
      "source.organizeImports.biome": "explicit"
  },

Now when I open a TSX file, I don’t get any squiggly lines. Also, when I manually run “Format Document”, I get this error: "Extension 'Biome' is configured as formatter but it cannot format 'TypeScript JSX'-files"

Screenshot 2024-08-14 at 10 39 04

Furthermore, every time I open the workspace, it complains that the Biome CLI is not installed even though it is. (I open the root of my repo which has the biome.json and package.json, biome was installed in node_modules with yarn 3.6.3.)

Maybe related to https://github.com/biomejs/biome-vscode/issues/283

Steps to reproduce

Install Biome and extension according to docs.

Open your project root folder in VSCode.

Open a TSX file.

Linting and formatting does not work.

Expected behavior

Works.

Does this issue occur when using the CLI directly?

No

Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 22 (8 by maintainers)

Most upvoted comments

It also is happening with Bun

in vscode it work,but in cursor it error

It worked for me using your repro.

clone -> yarn install -> reload VS code (you need to reload Vs code if you install Biome after extension init)

Biome output in VSCode:

Could not resolve Biome in the dependencies of workspace folder: /path/to/biome-test
Searching for Biome in PATH
Extension bundle does not include the prebuilt binary

And the “Biome Trace” output is empty.