Skip to content
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

🐛 Biome return errors more than one #218

Closed
1 of 3 tasks
throrin19 opened this issue May 16, 2024 · 14 comments
Closed
1 of 3 tasks

🐛 Biome return errors more than one #218

throrin19 opened this issue May 16, 2024 · 14 comments
Labels
Bug confirmed Report has been confirmed as a valid bug Help wanted External contributions are welcome

Comments

@throrin19
Copy link

VS Code version

1.89.1

Extension version

2.2.2

Biome version

1.7.3

Operating system

  • Windows
  • macOS
  • Linux

Description

Hello, We have a weird problem in our vscode with biome.

Sometimes Biome doesn't display warnings once, but x times, as if there were several instances of Biome in the background.

This is all the more problematic when saving fixes (and especially when reordering imports), which can cause Biome to step on itself between its different instances.

The only way we've found to undo this is to completely restart VSCode, which is not an acceptable solution in the medium/long term :

image

And for example before formating :

import { httpErrorMiddleware } from '@aquassay/errors';
import middy from '@aquassay/helper-middy';
import { httpPostMiddlewares } from '@aquassay/helper-middy';
import { getOrg, rightMiddlewares } from '@aquassay/middleware-rights';
import ImportMeasureSchema from '../schemas/importMeasure.js';
import { validate } from '@aquassay/middleware-validator';
import { success } from '@aquassay/responses';
import { convertFileToMeasures } from '../helpers/file.js';
import ImportSchema from '../schemas/import.js';

And after :

import { httpErrorMiddleware } from '@aquassay/errors';
import middy from '@aquassay/helper-middy';
import { httpPostMiddlewares } from '@aquassay/helper-middy';
import { getOrg, rightMiddlewares } from '@aquassay/middleware-rights';
import ImportSchema from '../schemas/import.js';
import ImportMeasureSchema from '../schemas/importMeasure.js';
import ImportMeasureSchema from '../schemas/importMeasure.js';
import ImportMeasureSchema from '../schemas/importMeasure.js';
import ImportMeasureSchema from '../schemas/importMeasure.js';

Steps to reproduce

Unknown, We don't know why biome runs several times in the background

Expected behavior

Biome for vscode launch correctly with only one instance and all formatting is correct.

Does this issue occur when using the CLI directly?

Not sure / Not applicable

Logs

No response

@Xerios
Copy link

Xerios commented Jul 11, 2024

This issue has been annoying me for quite some time. Happens quite often and its been like that since as long as I can remember.

  • Very hard to reproduce, but I think it occurs often during refactors (although it might've occurred once for a very large js file few months ago, but it wasn't reproducible)
  • > Biome restart LSP server doesn't fix the issue (bugged instances still remain even on newer code or files)
  • Duplicated msgs/bugged instances only grow (e.g. it starts with two duplicate errors then eventually through unknown means it becomes x7 )
  • Biome output or trace don't seem to contain any useful information or errors
  • Nothing helpful in vscode's DevTools
  • > Developer: Reload Window fixes the issue
  • happened when I had biome part my package.json and it also happens now that I use bundled version

biome version: since 1.6.x to current 1.8.3
vscode version: since 1.88.x to current 1.91.0
platform: windows

image

const currDate = Number.parseIntarseIntarseIntarseIntarseIntarseIntarseInt(window.revision, 36)

Observed behavior

The erroneous change doesn't get applied in one go, I can see it parseInt duplicating several times (most likely up to the amount of error messages) until it settles. Often misses a letter or modifies an unrelated line making the whole code into a mess.

This affects any fixable rule (e.g. template strings, imports, etc.. ) which ends up being applied multiple times. Doesn't matter if it's a manual "Quick Fix" or through "format on save". This happens for both linter's auto-fixes and formatter, both are affected.

This often corrupts the code in a noticeable way, but sometimes the corrupted code ends up being subtle and valid which ends up wasting a lot of time (e.g. when it only duplicates two times).

When multiple auto-fixes are present in the file, it can completely destroy parts of the code. Almost as if each biome instance has their content cached and is unaware of previous biome instance's changes, which ends up in with every biome instance applying their changes blindly like 7 monkeys trying to type a sentence at the same time on a single typewritter.

I'm unsure how exactly to replicate this issue, but I do think this happens more often when I'm refactoring code (e.g. find and replace across multiple files) then saving multiple files ( saveAll command using Ctrl+K S shortcut )

Perhaps unrelated: Old version of biome.json file got loaded while I was changing file. Oddly enough I had latest version of config loaded, made a new change, then it loaded the version prior to my latest. Unfortunately, I didn't check if I had duplicate biome msgs due to my sudden reflex of reloading the app.

Temp workaround

Using > Developer: Reload Window command in Command Palette fixes this until it occurs again.

@ematipico
Copy link
Member

The root cause is multiple instances of the Daemon being created by the VSCode extension.

This explains why the trace output isn't helpful.

I wish there was a predictable way to reproduce it.

@Xerios
Copy link

Xerios commented Jul 11, 2024

Just discovered another issue, perhaps related.

While trying to enable biome, which was somehow disabled, it attempted to download the version I picked and then gave this error:

Unable to write file 'vscode-userdata:/c:/Users/username/AppData/Roaming/Code/User/globalStorage/biomejs.biome/server/biome.exe' (Unknown (FileSystemError): 
Error: EBUSY: resource busy or locked, open 'c:\Users\username\AppData\Roaming\Code\User\globalStorage\biomejs.biome\server\biome.exe')

Somehow I ended up with a rogue biome.exe __run_server --stop-on-disconnect process.
Seeing this, I realized that unlike most other extensions:

  • It is not a child process of vscode
  • it doesn't have --clientProcessId=12345, which according to LSP specs is used to shutdown in case that PID is no longer present

I'm don't know much about vscode extension development, but surely there has to be multiple ways of enforcing a single instance of biome. If this extension made use of client/server approach like vscode-linter-xo, I would've made some effort to fix this and make a PR.

@throrin19
Copy link
Author

I notice biome return more execution error if we switch git branch with important changes (new files, ...)

@Xerios
Copy link

Xerios commented Jul 11, 2024

Bug re-appeared as it always does, with x3 instances. This time I have some usable info thanks.

I haven't switched my branch since last time I noticed the bug, but recently I did stage bunch of changes before I noticed the bug again.

Killing the biome.exe process

I thought I would try killing the extra biome processes, but it turns out there's still only one process.
Surely if I killed the process, it should properly fix itself? Right? Well, guess what.

  • The extension properly detects biome is down
  • It spawns biome process, and then....
  • it initiates x3 connections 👀
  • This happens consistently when killing the process, it always tries to initiate 3 connections to same PID
  • Auto-fixes and formatting are applied 3x times, so restarting biome.exe had no effect

Here are the Biome logs after clearing the output and then killing process

[cli-stdout] end
[cli-stderr] end
[cli-stdout] finish
[cli-stderr] finish
[cli-stderr] close
[cli] close 0
[cli-stdout] close
[Info  - 3:35:50 PM] Connection to server got closed. Server will restart.
true
[Info  - 3:35:50 PM] Connection to server got closed. Server will restart.
true
[Info  - 3:35:50 PM] Connection to server got closed. Server will restart.
true
[cli-stderr] data 18
[cli-stderr] data 84
[cli-stderr] data 215
[cli-stderr] data 113
[cli-stdout] data 29
[cli-stderr] end
[cli-stdout] end
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli-stderr] close
[cli] exit 0
[cli] close 0
Connecting to "\\.\pipe\biome-service-1.8.3" ...
[cli-stdout] data 29
[Info  - 3:35:50 PM] Server initialized with PID: 40632
[cli-stdout] end
[cli-stderr] end
[cli-stdout] finish
[cli-stderr] finish
[cli-stderr] close
[cli-stdout] close
[cli] exit 0
[cli] close 0
Connecting to "\\.\pipe\biome-service-1.8.3" ...
[Info  - 3:35:50 PM] Server initialized with PID: 40632
[cli-stdout] data 29
[cli] exit 0
Connecting to "\\.\pipe\biome-service-1.8.3" ...
[Info  - 3:35:51 PM] Server initialized with PID: 40632

Does this mean that the connection issue is caused on the client side rather than the biome LSP server itself?

I hope these new logs are helpful.

@nhedger nhedger added Bug confirmed Report has been confirmed as a valid bug Help wanted External contributions are welcome and removed Triage labels Jul 17, 2024
@0-CAT
Copy link

0-CAT commented Aug 5, 2024

Is there any kind of trace or useful information that people who encounter this can provide? I see this issue almost constantly.

image

The worst part of it is that if I save w/ auto-fix, it fixes it... repeatedly:

image

Using "Reload Window" as mentioned previously in this thread does indeed stop all the existing Biome instances and resets to having just one running.

Here is my Biome output content; "Biome Trace" output window is empty.

Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
[cli-stdout] data 62
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[Info  - 1:44:58 PM] Server initialized with PID: 34145
Reloading biome executable.
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
[cli-stderr] end
[cli-stdout] end
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli] close 0
[cli-stderr] close
Error copying file: EntryNotFound (FileSystemError): Unable to delete nonexistent file '/Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome'
Executing Biome from: /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
[cli-stdout] data 62
[cli] exit 0
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stderr] end
[cli-stderr] end
[cli-stdout] end
[cli-stdout] end
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli-stderr] finish
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] finish
[cli-stdout] close
[cli-stdout] close
[cli] close 0
[cli-stderr] close
[cli-stderr] close
[cli] exit 0
[cli] close 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[Info  - 1:53:51 PM] Server initialized with PID: 34654
[Info  - 1:53:51 PM] Server initialized with PID: 34654
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[Info  - 1:53:52 PM] Server initialized with PID: 34654
Reloading biome executable.
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stderr] end
[cli-stderr] end
[cli-stdout] end
[cli-stdout] end
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli-stderr] finish
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] finish
[cli-stdout] close
[cli-stdout] close
[cli-stderr] close
[cli] close 0
[cli-stderr] close
[cli-stderr] end
[cli-stdout] end
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli] exit 0
[cli] close 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli] close 0
[cli-stderr] close
[Info  - 1:54:05 PM] Server initialized with PID: 34654
[Info  - 1:54:05 PM] Server initialized with PID: 34654
[Info  - 1:54:05 PM] Server initialized with PID: 34654
Reloading biome executable.
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stderr] end
[cli-stdout] end
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli] close 0
[cli-stderr] close
[cli-stderr] end
[cli-stdout] end
[cli-stderr] end
[cli-stdout] end
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli-stderr] finish
[cli-stdout] finish
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli] close 0
[cli-stderr] close
[cli-stdout] close
[cli] close 0
[cli-stderr] close
[Info  - 1:59:40 PM] Server initialized with PID: 34654
[Info  - 1:59:40 PM] Server initialized with PID: 34654
[Info  - 1:59:40 PM] Server initialized with PID: 34654
Reloading biome executable.
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stderr] end
[cli-stderr] end
[cli-stdout] end
[cli-stdout] end
[cli-stderr] end
[cli-stdout] end
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli-stderr] finish
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] finish
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli-stderr] close
[cli-stdout] close
[cli-stdout] close
[cli] close 0
[cli-stderr] close
[cli-stderr] close
[cli] exit 0
[cli] close 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli] exit 0
[cli] close 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[Info  - 1:59:50 PM] Server initialized with PID: 34654
[Info  - 1:59:50 PM] Server initialized with PID: 34654
[Info  - 1:59:50 PM] Server initialized with PID: 34654
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
[cli-stdout] data 62
[cli-stderr] end
[cli-stdout] end
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli-stderr] close
[cli] exit 0
[cli] close 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[Info  - 2:01:51 PM] Server initialized with PID: 34654
Reloading biome executable.
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stderr] end
[cli-stdout] end
[cli-stderr] end
[cli-stdout] end
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli-stderr] finish
[cli-stdout] finish
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli-stderr] close
[cli-stdout] close
[cli] close 0
[cli-stderr] close
[cli-stderr] end
[cli-stdout] end
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli] exit 0
[cli] close 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli] close 0
[cli-stderr] close
[Info  - 2:02:26 PM] Server initialized with PID: 34654
[Info  - 2:02:26 PM] Server initialized with PID: 34654
[Info  - 2:02:26 PM] Server initialized with PID: 34654
Reloading biome executable.
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Reloading biome executable.
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Biome binary found at /Users/[FAKEPATH]/Code/[FAKEPATH]/node_modules/.pnpm/@biomejs+cli-darwin-arm64@1.8.3/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Copying binary to temporary folder: file:///Users/[FAKEPATH]/Library/Application%20Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
Executing Biome from: /Users/[FAKEPATH]/Library/Application Support/Code/User/workspaceStorage/ee844c7b4ea4af9e429873e0f4acb7f1/biomejs.biome/biome
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stdout] data 62
[cli-stderr] end
[cli-stdout] end
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli] close 0
[cli-stderr] close
[cli-stderr] end
[cli-stderr] end
[cli-stdout] end
[cli-stdout] end
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli] exit 0
Connecting to "/Users/[FAKEPATH]/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[cli-stderr] finish
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] finish
[cli-stdout] close
[cli-stdout] close
[cli] close 0
[cli-stderr] close
[cli] close 0
[cli-stderr] close
[Info  - 2:02:32 PM] Server initialized with PID: 34654
[Info  - 2:02:32 PM] Server initialized with PID: 34654
[Info  - 2:02:32 PM] Server initialized with PID: 34654
[Warn  - 2:06:28 PM] Code formatting aborted due to parsing errors. To format code with errors, enable the 'formatter.formatWithErrors' option.

@ematipico
Copy link
Member

ematipico commented Aug 5, 2024

@0-CAT you have multiple instances of the Daemon. Try to open your task manager and kill all the Biome processes. That should fix the issue

@0-CAT
Copy link

0-CAT commented Aug 5, 2024

@ematipico Yeah, that's correct. I can confirm that two daemons are running.

image

image

Killing the processes works exactly the same as "Reload Window" as a workaround. It's good that these workarounds exist, but the issue is that there's no reason Biome should be in this state. I didn't launch those daemon processes intentionally. The VSCode extension is doing it in the background.

@throrin19
Copy link
Author

@ematipico I'm agree with @0-CAT It's not normal biome duplicate his instance many times randomly.

@nhedger
Copy link
Member

nhedger commented Aug 6, 2024

I believe no one is disputing the fact that it's not normal behavior.

This kind of issue is hard to troubleshoot. In the next major version of the extension, the LSP won't be done over sockets, but using the lsp-proxy and hopefully it will solve this issue.

@ematipico
Copy link
Member

Thank you @nhedger for chiming in

@throrin19 @0-CAT my suggestion was a workaround to fix the issue, in case it happens again.

I believe the issue is caused by updating Biome multiple times using the same VSCode instance over time.

@radium-v
Copy link

Another workaround is to run the command "Developer: Restart Extension Host".

@ematipico
Copy link
Member

I believe this issue will be fixed by the upcoming v3 of the extension.

The current version connects to the daemon using a socket, so it's a direct connection. A socket is created every time a new version of Biome is installed. Plus, multiple connections can be created to the same socket.

v3, instead, will use the lsp-proxy command, available via CLI. This is generally the way to go, because Biome itself takes care of the connection to its daemon.

@nhedger
Copy link
Member

nhedger commented Aug 22, 2024

This should be fixed in the latest nightly. Feel free to try it!

@nhedger nhedger closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug confirmed Report has been confirmed as a valid bug Help wanted External contributions are welcome
Projects
None yet
Development

No branches or pull requests

6 participants