emmettng
ElixirLS server initialization failed
I just started trying Elixir today and configuring the dev environment in vscode and got this error.
Here is some basic information below :
Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:20:20] [ds:20:20:10] [async-threads:1] [jit]
Elixir 1.12.2 (compiled with Erlang/OTP 24)
I created a project following this tutorial https://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html
After installing this vscode plugin " ElixirLS: Elixir support and debuggerv0.14.5"
I got this error message.
could not compile dependency :sourceror, “mix compile” failed. You can recompile this dependency with “mix deps.compile sourceror”, update it with “mix deps.update sourceror” or clean it with “mix deps.clean sourceror”
[Error - 21:37:22] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 21:37:22] Connection to server got closed. Server will restart.
true
[Error - 21:37:22] ElixirLS - kv client: couldn’t create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
I googled similar issues and no solution fixed my problem interestingly, there is no “.elixir_ls/” in the project root.
I think this must be a really trivial mistake and it took me 3 hours
First Post!
cloudytoday
Try creating a dummy project and adding {:sourceror, "~> 0.12.2"} to dependencies, then get and compile it with mix deps.get && mix deps.compile and tell us if it’s successful or not.
Most Liked
cloudytoday
I think I’ve added the sourceror successfully, however, I still got the error message
Yes you did, however there’s quite a number of warnings as well as you can see. From the sourceror README it reads that they DO support your version of Elixir and OTP, but as a first poke you could try installing fresher versions of each via ASDF package manager (very convenient and supports a lot of tools other than Elixir/OTP). After removing your old installations of Elixir and Erlang and installing ASDF following the instructions on their website:
asdf plugin-add elixir
asdf plugin-add erlang
asdf install erlang 25.3
asdf install elixir 1.14.4-otp-25
asdf global erlang 25.3
asdf global elixir 1.14.4-otp-25
Last Post!
la_219
Thank you for your quick reply! I tried it but it didn’t help. In the end, I downgraded the VS Code extension and that fixed it for me. So the chances that it is a problem in the extension and not in the LS itself are pretty high.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









