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

🐛 Latest version (1.7.2) keeps crashing #2681

Closed
1 of 3 tasks
angel-luis opened this issue May 1, 2024 · 13 comments · Fixed by #2664 or #2722
Closed
1 of 3 tasks

🐛 Latest version (1.7.2) keeps crashing #2681

angel-luis opened this issue May 1, 2024 · 13 comments · Fixed by #2664 or #2722
Labels
S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@angel-luis
Copy link

angel-luis commented May 1, 2024

VS Code version

1.88.1

Extension version

2.2.2

Biome version

1.7.2

Operating system

  • Windows
  • macOS
  • Linux

Description

The extension stops to work after some minutes.
image

Steps to reproduce

I've upgraded and also tried to reinstall the extension

Expected behavior

Don't crash, with the 1.7.1 doesn't crash.

Does this issue occur when using the CLI directly?

Not sure / Not applicable

Logs

Connecting to "/Users/angelluis/Library/Caches/dev.biomejs.biome/biome-socket-1.7.2" ...
[Info  - 17:35:11] Server initialized with PID: 70417
[Error - 17:50:25] Client Biome: connection to server is erroring. Shutting down server.
[Error - 17:50:25] Client Biome: connection to server is erroring. Shutting down server.
[Error - 17:50:25] Sending document notification textDocument/didOpen failed.
Error: write EPIPE
	at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
[Error - 17:50:25] Stopping server failed
  Message: This socket has been ended by the other party
  Code: -32099 
[Error - 17:50:25] Stopping server failed
  Message: This socket has been ended by the other party
  Code: -32099 
[Error - 17:50:25] Stopping server failed
  Message: This socket has been ended by the other party
  Code: -32099
@vbasky
Copy link

vbasky commented May 1, 2024

I have the same issue too.

Connecting to "/Users/vikram/Library/Caches/dev.biomejs.biome/biome-socket-1.7.2" ...
[cli-stderr] data 395
[Error - 09:28:49] Client Biome: connection to server is erroring. Shutting down server.
[Error - 09:28:49] Client Biome: connection to server is erroring. Shutting down server.
[Error - 09:28:49] Sending document notification textDocument/didOpen failed
Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
[cli-stdout] end
[cli-stdout] finish
[Error - 09:28:49] Sending document notification textDocument/didOpen failed
Error: This socket has been ended by the other party
    at Socket.writeAfterFIN [as write] (node:net:569:14)
    at /Users/vikram/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:3023:25
    at new Promise (<anonymous>)
    at WritableStreamWrapper.write (/Users/vikram/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:3014:16)
    at StreamMessageWriter.doWrite (/Users/vikram/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:1442:31)
    at /Users/vikram/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:1433:25
    at runNextTicks (node:internal/process/task_queues:60:5)
    at processImmediate (node:internal/timers:447:9)
[cli-stdout] close
[Error - 09:28:49] Connection to server got closed. Server will not be restarted.
[cli-stderr] end
[cli-stderr] finish
[cli] close 0
[cli-stderr] close
[Error - 09:28:49] Stopping server failed
  Message: This socket has been ended by the other party
  Code: -32099 
[Error - 09:28:49] Stopping server failed
  Message: This socket has been ended by the other party
  Code: -32099 
[Error - 09:28:49] Stopping server failed
  Message: This socket has been ended by the other party
  Code: -32099 

@nhedger nhedger transferred this issue from biomejs/biome-vscode May 2, 2024
@Sec-ant
Copy link
Member

Sec-ant commented May 2, 2024

This might be caused by some panic when the lsp is analyzing an opened file, so it would be much helpful if someone can provide the opened file/code when the error shows, so we can know which one caused it.

It will also be helpful to try using the CLI (check or ci command) and see if there're any panics in the current project.

@Sec-ant Sec-ant added S-Needs repro Status: needs a reproduction S-Needs response Status: await response from OP labels May 2, 2024
@angel-luis
Copy link
Author

angel-luis commented May 2, 2024

> This might be caused by some panic when the lsp is analyzing an opened file, so it would be much helpful if someone can provide the opened file/code when the error shows, so we can know which one caused it.

It will also be helpful to try using the CLI (check or ci command) and see if there're any panics in the current project.

It crashes with a Next.js project, with React code.

Just with clicking update, it crashes:

[Info  - 18:27:05] Server initialized with PID: 1438
[cli-stderr] end
[cli-stdout] end
[cli] exit null
[Error - 18:29:32] Biome client: couldn't create connection to server.
Error: Command "/Users/angelluis/Library/Application Support/Code/User/globalStorage/biomejs.biome/server/biome __print_socket" exited with code null
	at getSocket (/Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:36605:11)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async createMessageTransports (/Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:36619:16)
	at async LanguageClient2.createConnection (/Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:15598:28)
	at async LanguageClient2.start (/Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:15174:30)
	at async /Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:36209:9
	at async d.h (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:152:186866)
	at async /Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:35912:7
[Error - 18:29:32] Restarting client failed
Error: Command "/Users/angelluis/Library/Application Support/Code/User/globalStorage/biomejs.biome/server/biome __print_socket" exited with code null
	at getSocket (/Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:36605:11)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async createMessageTransports (/Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:36619:16)
	at async LanguageClient2.createConnection (/Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:15598:28)
	at async LanguageClient2.start (/Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:15174:30)
	at async /Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:36209:9
	at async d.h (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:152:186866)
	at async /Users/angelluis/.vscode/extensions/biomejs.biome-2.2.2/out/main.js:35912:7
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli] close null
[cli-stderr] close

Running biome check ./app (1.7.1 and 1.7.2) in the project it founds 24 errors, all of them the same error of be sorted:

  ✖ Import statements could be sorted:
  
     1    │ - import·{·PencilIcon,·PlusIcon,·TrashIcon·}·from·"@heroicons/react/24/outline";
     2    │ - import·Link·from·"next/link";
     3    │ - import·{·deleteInvoice·}·from·"@/app/lib/actions";
        1 │ + import·{·deleteInvoice·}·from·"@/app/lib/actions";
        2 │ + import·{·PencilIcon,·PlusIcon,·TrashIcon·}·from·"@heroicons/react/24/outline";
        3 │ + import·Link·from·"next/link";
     4  4 │   
     5  5 │   export function CreateInvoice() {

A file example of crashing:

import Link from "next/link";
import { FaceFrownIcon } from "@heroicons/react/24/outline";

export default function NotFound() {
	return (
		<main className="flex h-full flex-col items-center justify-center gap-2">
			<FaceFrownIcon className="w-10 text-gray-400" />
			<h2 className="text-xl font-semibold">404 Not Found</h2>
			<p>Could not find the requested invoice.</p>
			<Link
				href="/dashboard/invoices"
				className="mt-4 rounded-md bg-blue-500 px-4 py-2 text-sm text-white transition-colors hover:bg-blue-400"
			>
				Go Back
			</Link>
		</main>
	);
}

But if I restart and repone the file several times, it doesn't crash after a while...

@angel-luis
Copy link
Author

Now I can't even choose the 1.7.1 version... when I click in the extension does nothing (I've reinstalled several times).

@Sec-ant
Copy link
Member

Sec-ant commented May 2, 2024

Running biome check ./app (1.7.1 and 1.7.2) in the project it founds 24 errors, all of them the same error of be sorted

Errors are not the problem. I was expecting there may be some program crashes (panics) that cause the server to shutdown.

Now I can't even choose the 1.7.1 version... when I click in the extension does nothing (I've reinstalled several times).

The extension will install the latest biome when it cannot find one in your system path or in your project dependencies. So I think you can just change the version of biome in your project or in global to force the extension to use that version.

@Conaclos
Copy link
Member

Conaclos commented May 2, 2024

Have you tried disabling the linter and/or the formatter and/or the import organizer and see if the error persists? This is hard to help you without more precise information... Could you provide us the file that makes the Biome LSP crashes?

@angel-luis
Copy link
Author

Have you tried disabling the linter and/or the formatter and/or the import organizer and see if the error persists? This is hard to help you without more precise information... Could you provide us the file that makes the Biome LSP crashes?

I've always used Biome with the VSC without any Biome packing or CLI, so for me the options are enable or disable the extension. I'm 100% sure that before the 1.7.2 it has never crashed, and I've been using Biome at least 3-4 months. Above I've provided one file that causes the crash, I would be happy to provide more info, but I need to now exactly the steps to provide it!

@angel-luis
Copy link
Author

angel-luis commented May 2, 2024

The extension will install the latest biome when it cannot find one in your system path or in your project dependencies. So I think you can just change the version of biome in your project or in global to force the extension to use that version.

Before, if I clicked the extension, it showed me a list of all the versions. Now shows nothing. Very weird. Maybe is because I installed the CLI via homebrew to run the command you said me.

Edit: okay I now understand, always I've been using the binary downloaded by the extension, so the installation of the CLI deleted every binary. Now I've to added biome to the package.json to be able to use the 1.7.1.

@angel-luis
Copy link
Author

After some testing, it crashes when importing import Link from "next/link";.

@ematipico
Copy link
Member

@angel-luis can you please provide us with some logs?

You can retrieve them manually: https://biomejs.dev/guides/integrate-in-editor/#daemon-logs

Please make sure to copy the logs written right before the extension crashes

@angel-luis
Copy link
Author

@angel-luis can you please provide us with some logs?

You can retrieve them manually: https://biomejs.dev/guides/integrate-in-editor/#daemon-logs

Please make sure to copy the logs written right before the extension crashes

Cleaned log:

server.log.2024-05-03-09.txt

@Conaclos
Copy link
Member

Conaclos commented May 3, 2024

Thanks for the log, this was really helpful!

Biome crashes because of #2659 (TLDR: Biome crashes on conditional types with TypeScript infer). I fixed the issue two days ago. We will release a patch version soon because this affects many users.

@angel-luis
Copy link
Author

Thanks to you and the rest of the team, then we will wait to the patch! 👍

@angel-luis angel-luis changed the title 🐛 Latest version keeps crashing 🐛 Latest version (1.7.2) keeps crashing May 4, 2024
@Sec-ant Sec-ant added S-Bug-confirmed Status: report has been confirmed as a valid bug and removed S-Needs repro Status: needs a reproduction S-Needs response Status: await response from OP labels May 6, 2024
This was linked to pull requests May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
5 participants