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

🐛 You must have at least one workspace #4666

Open
3 tasks
johnlindquist opened this issue Sep 26, 2024 · 6 comments
Open
3 tasks

🐛 You must have at least one workspace #4666

johnlindquist opened this issue Sep 26, 2024 · 6 comments
Labels
A-LSP Area: language server protocol S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@johnlindquist
Copy link

VS Code version

Cursor 0.41.3

Extension version

biome-2024.9.200949

Biome version

1.9.2

Operating system

  • Windows
  • macOS
  • Linux

Description

2024-09-26 16:20:57.099 [info] Biome encountered an unexpected error

This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:

Source Location: crates/biome_service/src/settings.rs:75:14
Thread Name: tokio-runtime-worker
Message: You must have at least one workspace.

2024-09-26 16:20:57.103 [info] [Error - 4:20:57 PM] Handling connection error failed
2024-09-26 16:20:57.103 [info] TypeError: Cannot read properties of undefined (reading 'toString')
at Object.error (/Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:48582:28)
at BiomeLanguageClient.handleConnectionError (/Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:47045:71)
at errorHandler (/Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:46991:19)
at /Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:47374:37
at CallbackList.invoke (/Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:30421:40)
at Emitter.fire (/Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:30483:37)
at writeErrorHandler (/Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:31532:23)
at CallbackList.invoke (/Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:30421:40)
at Emitter.fire (/Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:30483:37)
at StreamMessageWriter.fireError (/Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:30975:28)
at Socket. (/Users/johnlindquist/.cursor/extensions/biomejs.biome-2024.9.200949/out/index.js:31012:48)
at Socket.emit (node:events:514:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
2024-09-26 16:20:57.103 [info] [Error - 4:20:57 PM] Sending document notification textDocument/didOpen failed
2024-09-26 16:20:57.103 [info] Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
2024-09-26 16:20:57.104 [info] [Error - 4:20:57 PM] Biome language server error
2024-09-26 16:20:57.104 [info] [Error - 4:20:57 PM] Request textDocument/codeAction failed.
2024-09-26 16:20:57.104 [info] Message: Cannot call write after a stream was destroyed
Code: -32099
2024-09-26 16:20:57.104 [info] [Error - 4:20:57 PM] Connection to server got closed. Server will not be restarted.
2024-09-26 16:20:57.104 [info] [Error - 4:20:57 PM] Stopping server failed
2024-09-26 16:20:57.104 [info] Message: Cannot call write after a stream was destroyed
Code: -32099
2024-09-26 16:20:57.104 [info] [Error - 4:20:57 PM] Stopping server failed
2024-09-26 16:20:57.104 [info] Message: Cannot call write after a stream was destroyed
Code: -32099
2024-09-26 16:24:55.531 [info] Biome encountered an unexpected error

Steps to reproduce

Simple open your project

Expected behavior

for it to work

Does this issue occur when using the CLI directly?

Not sure / Not applicable

Link to a minimal reproduction

No response

Logs

No response

@nhedger
Copy link
Member

nhedger commented Oct 4, 2024

I've been trying to reproduce this issue for quite some time.

Any chance you're able to reproduce it consistently? If so any additional information would help troubleshooting this.

@KurtGokhan
Copy link

KurtGokhan commented Oct 13, 2024

I had this issue with a new project I created. Latest VSCode stable version. I tried these but couldn't solve the problem:

  • Installed all 1.9.x versions individually. None worked.
  • Restarted VSCode, Extensions, LSP server. None worked.
  • Tried both the latest release and pre-release version of this extension. Although, the latest release version reports a different error with less details (data 393).

Then I tried these and some of them must have worked because it started working suddenly:

  • I noticed I had another VSCode workspace open. So I closed it.
  • Installed Biome v1.8.3 then reinstalled v1.9.3 again.
  • I noticed there was 1 minor issue in my Biome config. Fixed that.

Hope this helps.

@imertz
Copy link

imertz commented Oct 17, 2024

I had this issue with a new project I created. Latest VSCode stable version. I tried these but couldn't solve the problem:

  • Installed all 1.9.x versions individually. None worked.
  • Restarted VSCode, Extensions, LSP server. None worked.
  • Tried both the latest release and pre-release version of this extension. Although, the latest release version reports a different error with less details (data 393).

Then I tried these and some of them must have worked because it started working suddenly:

  • I noticed I had another VSCode workspace open. So I closed it.
  • Installed Biome v1.8.3 then reinstalled v1.9.3 again.
  • I noticed there was 1 minor issue in my Biome config. Fixed that.

Hope this helps.

Worked! Thanks!

@larsks
Copy link

larsks commented Nov 24, 2024

Hi there; I'm running neovim 0.10.2 with biome 1.9.4. When I open a javascript file, biome logs the message:

[ERROR][2024-11-24 15:03:34] .../vim/lsp/rpc.lua:770 "rpc" "/home/lars/.local/share/nvim/mason/bin/biome" "stderr" "Biome encountered an unexpected error\n\nThis is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:\n\nSource Location: crates/biome_service/src/settings.rs:78:14\nThread Name: tokio-runtime-worker\nMessage: You must have at least one workspace.\n\n"

I was going to open a new issue as requested, but the error suggests this is the same problem.

The error occurs when the directory from which I started neovim contains a biome.json file. Without the biome.json file, :LspInfo shows root directory: Not found.

@larsks
Copy link

larsks commented Nov 24, 2024

Ah, in this case, the message is a lie: the problem is that I had an empty biome.json file, which is invalid; if the file instead contains an empty json object ({}), it seems to work as expected.

@nhedger
Copy link
Member

nhedger commented Nov 30, 2024

Thanks, @larsks. I can consistently reproduce the error by emptying the biome.json file and reloading the window. This issue belongs to Biome itself, not the extension.

Steps to reproduce:

  1. Create a new reproduction repo: npm create @biomejs/biome-reproduction
  2. Empty the biome.json file.
  3. Reload the window
  4. See that the LSP server crashes
  5. See that the output contains a message similar to:
2024-11-30 23:05:09.038 [info] Biome encountered an unexpected error

This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:

Source Location: crates/biome_service/src/settings.rs:77:14
Thread Name: tokio-runtime-worker
Message: You must have at least one workspace.

@nhedger nhedger transferred this issue from biomejs/biome-vscode Nov 30, 2024
@nhedger nhedger added the S-Bug-confirmed Status: report has been confirmed as a valid bug label Nov 30, 2024
@ematipico ematipico added the A-LSP Area: language server protocol label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LSP Area: language server protocol S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

No branches or pull requests

6 participants