biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
13.92k stars 421 forks source link

🐛 Lots of crashes in VS Code / Could not connect to the Biome server #1819

Open eikowagenknecht opened 6 months ago

eikowagenknecht commented 6 months ago

Environment information

CLI:
  Version:                      1.5.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v20.10.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.2.4"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Workspace:
  Open Documents:               0

What happened?

Biome regularly crashes in VS Code. More often than not I see this little popup:

image

Logs from the "Biome" Output:

Biome binary found at c:\*****\*****\*****\node_modules\@biomejs\cli-win32-x64\biome.exe
Copying binary to temporary folder: file:///c%3A/Users/*****/AppData/Roaming/Code/User/workspaceStorage/27cd3cb02ff8195e374488eb4166ba68/biomejs.biome/biome.exe
Executing Biome from: c:\Users\*****\AppData\Roaming\Code\User\workspaceStorage\27cd3cb02ff8195e374488eb4166ba68\biomejs.biome\biome.exe
[cli-stdout] data 28
[cli] exit 0
Connecting to "\\.\pipe\rome-service-1.5.3" ...
[Info  - 2:34:27 PM] Server initialized with PID: 11564
Reloading biome executable.
Biome binary found at c:\*****\*****\*****\node_modules\@biomejs\cli-win32-x64\biome.exe
Copying binary to temporary folder: file:///c%3A/Users/*****/AppData/Roaming/Code/User/workspaceStorage/27cd3cb02ff8195e374488eb4166ba68/biomejs.biome/biome.exe
[cli-stderr] end
[cli-stdout] end
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli] close 0
[cli-stderr] close
Executing Biome from: c:\Users\*****\AppData\Roaming\Code\User\workspaceStorage\27cd3cb02ff8195e374488eb4166ba68\biomejs.biome\biome.exe
[cli-stdout] data 28
[cli] exit 0
Connecting to "\\.\pipe\rome-service-1.5.3" ...
[Info  - 2:36:12 PM] Server initialized with PID: 4520
[Warn  - 2:37:17 PM] Format with errors is disabled.
Reloading biome executable.
Biome binary found at c:\*****\*****\*****\node_modules\@biomejs\cli-win32-x64\biome.exe
Copying binary to temporary folder: file:///c%3A/Users/*****/AppData/Roaming/Code/User/workspaceStorage/27cd3cb02ff8195e374488eb4166ba68/biomejs.biome/biome.exe
Executing Biome from: c:\Users\*****\AppData\Roaming\Code\User\workspaceStorage\27cd3cb02ff8195e374488eb4166ba68\biomejs.biome\biome.exe
[cli-stdout] data 28
[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\rome-service-1.5.3" ...
[Error - 2:37:30 PM] Biome client: couldn't create connection to server.
Error: connect ENOENT \\.\pipe\rome-service-1.5.3
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
Reloading client failed: Error: Could not connect to the Biome server at "\\.\pipe\rome-service-1.5.3": connect ENOENT \\.\pipe\rome-service-1.5.3
[cli-stdout] end
[cli-stderr] end
[cli-stdout] finish
[cli-stderr] finish
[cli-stderr] close
[cli] close 0
[cli-stdout] close
Reloading biome executable.
Biome binary found at c:\*****\*****\*****\node_modules\@biomejs\cli-win32-x64\biome.exe
Copying binary to temporary folder: file:///c%3A/Users/*****/AppData/Roaming/Code/User/workspaceStorage/27cd3cb02ff8195e374488eb4166ba68/biomejs.biome/biome.exe
Executing Biome from: c:\Users\*****\AppData\Roaming\Code\User\workspaceStorage\27cd3cb02ff8195e374488eb4166ba68\biomejs.biome\biome.exe
[cli-stdout] data 28
[cli] exit 0
Connecting to "\\.\pipe\rome-service-1.5.3" ...
[Info  - 2:44:27 PM] Server initialized with PID: 3760

Logs from biome-logs folder:

biome-log.txt

Expected result

It should not crash.

Code of Conduct

ematipico commented 6 months ago

@nhedger

Is it expected that the extension copies the executable to the temporary directory?

Biome binary found at c:\*****\*****\*****\node_modules\@biomejs\cli-win32-x64\biome.exe
Copying binary to temporary folder: file:///c%3A/Users/*****/AppData/Roaming/Code/User/workspaceStorage/27cd3cb02ff8195e374488eb4166ba68/biomejs.biome/biome.exe
Executing Biome from: c:\Users\*****\AppData\Roaming\Code\User\workspaceStorage\27cd3cb02ff8195e374488eb4166ba68\biomejs.biome\biome.exe
nhedger commented 6 months ago

Yes. We do that to prevent locking the binary in the project’s dependencies which prevents users from upgrading biome with their package manager if the server has been started. This is typically an issue we witnessed on windows.

eikowagenknecht commented 6 months ago

Running Biome in a completely fresh VS Code (portable) it seems to be better now. But I noticed that I can still regularly get Biome to crash by running npm i ... or anything else that modifies the package.json / package-lock.json.

john-aws commented 3 months ago

Unusable for me in VS Code Insiders 1.90.0-insider on Mac Ventura 13.6.6 (M1), and earlier versions.

Example of output:

Could not resolve Biome in the dependencies of workspace folder: /Users/me/src/myproj
Searching for Biome in PATH
Biome binary found at /Users/me/Library/Application Support/Code - Insiders/User/globalStorage/biomejs.biome/server/biome
Executing Biome from: /Users/me/Library/Application Support/Code - Insiders/User/globalStorage/biomejs.biome/server/biome
[cli-stderr] end
[cli-stdout] end
[cli] exit null
[Error - 2:56:53 PM] Biome client: couldn't create connection to server.