Stream: beginners

Topic: can't run language server


view this post on Zulip Korny Sietsma (Aug 30 2024 at 18:17):

Hey folks - just trying to get started (fetched a new nightly) on an M3 Mac, and I can run the compiler and samples OK, but the language server in VSCode errors with:

[Error - 19:09:58] Client roc-lang: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"result\":null,\"id\":2}Content-Length: 180"}
Shutting down server.

If I run the binary language server from a terminal I get something similar:

./roc_language_server

[2024-08-30T18:10:23Z ERROR tower_lsp::transport] failed to decode message: missing required `Content-Length` header
Content-Length: 75

{"jsonrpc":"2.0","error":{"code":-32700,"message":"Parse error"},"id":null}%

Any thoughts? I searched for issues but found nothing similar.

view this post on Zulip Anton (Aug 30 2024 at 18:22):

Hi @Korny Sietsma,
Can you try the steps here?

view this post on Zulip Anton (Aug 30 2024 at 18:23):

I suspect not all these steps are necessary but doing them all will probably fix it.

view this post on Zulip Korny Sietsma (Aug 30 2024 at 18:50):

Ha - I started looking at that and saw

I needed to reinstall the extention after adding the configuration, and manually re-start the language server, and then it worked!

I'd already tried stopping and starting VSCode - but not just the language server. I stopped and started the language server - and now it works!


Last updated: Jul 05 2025 at 12:14 UTC