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
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.
mix deps.compile
==> sourceror
Compiling 10 files (.ex)
warning: Sourceror.Code.Formatter.to_algebra/2 is undefined (module Sourceror.Code.Formatter is not available or is yet to be defined)
lib/sourceror/code.ex:78: Sourceror.Code.quoted_to_algebra/2
warning: Sourceror.Code.Normalizer.normalize/2 is undefined (module Sourceror.Code.Normalizer is not available or is yet to be defined)
lib/sourceror/code.ex:77: Sourceror.Code.quoted_to_algebra/2
warning: :sourceror_elixir.string_to_tokens/5 is undefined (module :sourceror_elixir is not available or is yet to be defined)
lib/sourceror/code.ex:21: Sourceror.Code.string_to_quoted_with_comments/2
warning: :sourceror_elixir.tokens_to_quoted/3 is undefined (module :sourceror_elixir is not available or is yet to be defined)
lib/sourceror/code.ex:22: Sourceror.Code.string_to_quoted_with_comments/2
warning: :sourceror_errors.parse_error/4 is undefined (module :sourceror_errors is not available or is yet to be defined)
lib/sourceror/code.ex:37: Sourceror.Code.string_to_quoted_with_comments!/2
warning: Mix.Tasks.Format.formatter_for_file/1 is undefined or private. Did you mean one of:
I think I’ve added the sourceror successfully, however, I still got the 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 - 00:42:42] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 00:42:42] The ElixirLS - kv server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 00:42:42] ElixirLS - kv client: couldn’t create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 00:42:42] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
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:
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.
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.
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”
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?
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:
warning: redefining module Sourceror (current version loaded from ~/.local/share/lvim/mason/packages/elixir-ls/sourceror-0.11.2.ez/sourceror-0.11.2/ebin/Elixir.Sourceror.beam)\n lib/sourceror.ex:1\n
(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.
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.