biomejs / biome-vscode

Biome extension for Visual Studio Code and VSCodium
https://marketplace.visualstudio.com/items?itemName=biomejs.biome
Apache License 2.0
182 stars 20 forks source link

🐛 Biome return errors more than one #218

Closed throrin19 closed 2 weeks ago

throrin19 commented 3 months ago

VS Code version

1.89.1

Extension version

2.2.2

Biome version

1.7.3

Operating system

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 commented 1 month ago

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.

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 commented 1 month ago

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 commented 1 month ago

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:

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 commented 1 month ago

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

Xerios commented 1 month ago

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.

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.

0-CAT commented 1 month ago

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 commented 1 month ago

@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 commented 1 month ago

@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 commented 1 month ago

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

nhedger commented 1 month ago

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 commented 1 month ago

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 commented 3 weeks ago

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

ematipico commented 3 weeks ago

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 commented 2 weeks ago

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