biome-vscode: š Biome return errors more than one
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 :
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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 18 (7 by maintainers)
This should be fixed in the latest nightly. Feel free to try it!
Another workaround is to run the command āDeveloper: Restart Extension Hostā.
@kliakhovskii-brex install the pre-release version of the extension and restart VSCode
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.
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-proxycommand, available via CLI. This is generally the way to go, because Biome itself takes care of the connection to its daemon.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 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.
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.
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.exeprocessI 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.
biome.exehad no effectHere are the Biome logs after clearing the output and then killing process
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.