-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Error when running format: Extension 'Biome' is configured as formatter but it cannot format 'TypeScript JSX'-files #302
Comments
Do you use yarn pnp? Which version of yarn do you use? Have you tried another package manager? Ultimately, can you provide a reproduction? |
I'm using yarn with node_modules
Is your guess that the root cause of the error is that the extension cannot find the CLI? I'll try to create an isolated reproduction. |
It's possible that yarn didn't install the optional dependencies. You should see a |
Here's a minimal repo: https://github.com/graup/biome-test This is what node_modules looks like: |
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) |
We should probably add this important detail in our documentation |
That's weird. I already tried restarting or reloading VSCode, this doesn't fix the problem for me. Maybe something off with my VSCode... I just tried resetting my VSCode settings and disabled all other extensions but I'm still getting the same error "Could not find Biome in your dependencies." (To clarify, I'm opening the root folder in VSCode.) |
my way to solve this problem: |
Same here with yarn. When yarn building process not successfully done or yarn checksum issue, then the vscode not found biome as formatter. |
I'm afraid using a different package manager is not an option for me, this is a large project in production. Could nobody else reproduce my issue in my repro? |
What does the Biome output say ? |
The CLI works as expected.
|
Sorry I meant the Biome output in VS Code. In your output panel you should see Biome and there should be the logs of the extension. Hopefully it tells us more about why the session is not being created |
Biome output in VSCode:
And the "Biome Trace" output is empty. |
Actually, I was wrong. The error is triggered when the actual bin file cannot be found on disk. |
Thanks for the idea. However, I have not set |
Using you repro, it finds the binary correctly.
Also, you mentioned using Yarn |
Yeah, I tried updating yarn, but it didn't help. Hmm, so it must be something with my environment. I will keep trouble-shooting and report back if I find anything. Thanks for your help so far. |
Would you mind trying to install with npm instead just to see if this has an impact ? |
I finally managed to test it with a different package manager. Happy to report that it works fine in pnpm. So maybe a yarn issue in my specific environment |
It also is happening with Bun |
VS Code version
1.92.1
Extension version
v2024.5.251958
Biome version
1.8.3
Operating system
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:
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"
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 #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
The text was updated successfully, but these errors were encountered: