-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Comments
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: const currDate = Number.parseIntarseIntarseIntarseIntarseIntarseIntarseInt(window.revision, 36) Observed behaviorThe erroneous change doesn't get applied in one go, I can see it 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 ( Perhaps unrelated: Old version of Temp workaroundUsing |
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. |
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:
Somehow I ended up with a rogue
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. |
I notice biome return more execution error if we switch git branch with important changes (new files, ...) |
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
|
Is there any kind of trace or useful information that people who encounter this can provide? I see this issue almost constantly. The worst part of it is that if I save w/ auto-fix, it fixes it... repeatedly: 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.
|
@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 |
@ematipico Yeah, that's correct. I can confirm that two daemons are running. 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. |
@ematipico I'm agree with @0-CAT It's not normal biome duplicate his instance many times randomly. |
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. |
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. |
Another workaround is to run the command "Developer: Restart Extension Host". |
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 |
This should be fixed in the latest nightly. Feel free to try it! |
@ematipico Has this been released? Feels like the last extension version is v2.3 that's released in June of the last year. We're actively adopting Biome, and a lot of ppl seems to be bumping into this issue with their VSCode. Wonder if the fix can make it to the VSCode extension store |
@kliakhovskii-brex install the pre-release version of the extension and restart VSCode |
Yeah saw the prerelease version from 2024.12.2, I guess it means the release version is still with the bug :) Will make folks aware of it! |
Stable → This bug |
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 :
And for example before formating :
And after :
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
The text was updated successfully, but these errors were encountered: