emmettng
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
Trending in Questions
Other Trending 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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
cloudytoday
Try creating a dummy project and adding
{:sourceror, "~> 0.12.2"}to dependencies, then get and compile it withmix deps.get && mix deps.compileand tell us if it’s successful or not.emmettng
Thank you so much for your help.
After adding the dependencies and compiling as instructed
I think I’ve added the sourceror successfully, however, I still got the error message :
The dummy project is created using
cloudytoday
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:
tino415
It looks like elixir-ls don’t even started. I don’t use vs code but maybe you could try to clone and build elixir-ls locally. It is in this repo GitHub - elixir-lsp/elixir-ls: A frontend-independent IDE "smartness" server for Elixir. Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol" · GitHub, for starter maybe just try
deps.get,compileandiex -S mix. Maybe even details about your laptop like os and architecture can be useful, If I remember right, vs code elixir-ls plugin is boundling already build version of elixir-ls.emmettng
It works now and thanks so much for your help!
There is some other issue I’d like to mention …
After installing asdf
For some reason, most of the files in the folder .asdf/shims folder look like this
which actually should be
just cannot believe why this kind of matured toolkit makes this mistake.
probably there is something fundamentally wrong with my OS configuration…
cloudytoday
Mine point at the correct locations, but I can’t comment on this, I don’t know much about ASDF and bash scripting. Glad to hear it worked out for you!
lukaszsamson
Why would you include sourceror in your project deps? Btw you are using a not supportd elixir and otp combination. Eithe update elixir o downgrade otp.
la_219
I have a similar problem (but with a supported version: Elixir 1.13.4 (compiled with Erlang/OTP 24).
It always says the same when starting VS Code.
The thing is - I don’t have this dependency in my workspace, never had and I don’t need it. But I cannot clean it. Any restarts, deleting of deps etc. didn’t work. Do you have any other ideas how to solve this?
lukaszsamson
Do you have hex installed? See ElixirLS - linked_list client: couldn't create connection to server. · Issue #339 · elixir-lsp/vscode-elixir-ls · GitHub
Can you try cleaning up your mix install cache directory (you can get it with
Mix.Utils.mix_cache())linusdm
I have the same sourceror warnings in my lsp logs (running in neovim). No matter what folder I remove (including the mix cache directory as you suggested), the warning keeps coming back. But the LSP works, so it’s not breaking anything for me. In addition to the final warning as shown before, I also have several of these warnings preceding:
(this warning is repeated for a few Sourceror modules).
It’s not clear to me, @la_219, what the observed malfunctioning is, except from the warnings.