dmur

dmur

ElixirLS extension for VSCode not starting on Ubuntu

I am brand new to Elixir.

The ElixirLS extension doesn’t start for me in VSCode.

After I open VSCode in a project called “project” and load a .ex file, I get some flashed messages:

  • ElixirLS - project client: couldn’t create connection to server.
  • Pending response rejected since connection got disposed
  • The ElixirLS - project server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
** (UndefinedFunctionError) function ElixirLS.LanguageServer.CLI.main/0 is undefined (module ElixirLS.LanguageServer.CLI is not available)
    ElixirLS.LanguageServer.CLI.main()
    nofile:1: (file)
    (stdlib 6.1.2) erl_eval.erl:904: :erl_eval.do_apply/7
    (elixir 1.18.0-dev) lib/code.ex:572: Code.validated_eval_string/3
[Error - 20:42:32] The ElixirLS - aoc24 server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 20:42:32] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 20:42:32] ElixirLS - aoc24 client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 20:42:32] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097

My symptoms are almost identical to this thread from 2023: ElixirLS (VSCode extension) installation issue on WSL2, Ubuntu

The solution in that case was to downgrade from ElixirLS 0.14.0 to 0.13.0. However, I’m already on 0.13.0, and in fact, that is the most recent version available for me through the VSCode Extension installer.

I have elixir installed through asdf. “elixir”, “mix”, and “iex” all work fine. I think I have “hex” installed too: the output of “mix local.hex” is

Found existing entry: /home/david/.asdf/installs/elixir/main/.mix/archives/hex-2.1.1
Are you sure you want to replace it with "https://builds.hex.pm/installs/1.16.0/hex-2.1.1.ez"? [Yn]

I am running Ubuntu 22.04.

* Elixir & Erlang versions (elixir --version): Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Elixir 1.18.0-dev (d97b29f) (compiled with Erlang/OTP 25)

* VSCode ElixirLS version: 0.13.0
* Operating System Version: linux 6.8.0-49-generic

Marked As Solved

gpopides

gpopides

Your versions are a bit off. You are using latest elixir (1.18) but your elixir-ls version is 0.13 which is almost 2 years old.

Elixir 1.18 is not yet supported by elixir ls as per crash with elixir 1.18 · Issue #1145 · elixir-lsp/elixir-ls · GitHub

You can either wait for the next version or use 1.17 with elixirls 0.25.0

Last Post!

dmur

dmur

Sorry for the slow response here, I was away over Christmas.

Thanks for the explanation. I also had an old VSCode not compatible with versions of elixirls greater than 0.13.0, which explains why it chose that version.

Elixirls is working fine for me now after:

  • upgrading VSCode to 1.96.2
  • upgrading elixirls to 0.25.0
  • downgrading elixir to 1.17.3

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54006 488
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New

We're in Beta

About us Mission Statement