Skip to content

Pending response rejected since connection got disposed + (Mix.Error) Could not compile dependency #1172

@matisnape

Description

@matisnape

This is a long story, starting with me trying to fix Go to definition. I've managed to fix the standard library, but not my project library.

I noticed then, that ElixirLS, at version 0.27.1, breaks on this

[Error - 16:59:01] Process #PID<0.229.0> raised an exception
** (Mix.Error) Could not compile dependency :rabbit_common, "/Users/anks/.asdf/installs/elixir/1.17.3-otp-26/.mix/elixir/1-17/rebar3 bare compile --paths /Users/anks/projects//integrations/be/.elixir_ls/build/test/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile rabbit_common --force", update it with "mix deps.update rabbit_common" or clean it with "mix deps.clean rabbit_common"
    (mix 1.17.3) lib/mix.ex:588: Mix.raise/2
    (mix 1.17.3) lib/mix/tasks/deps.compile.ex:306: Mix.Tasks.Deps.Compile.do_command/5
    (mix 1.17.3) lib/mix/tasks/deps.compile.ex:211: Mix.Tasks.Deps.Compile.do_rebar3/2
    (mix 1.17.3) lib/mix/tasks/deps.compile.ex:93: anonymous fn/4 in Mix.Tasks.Deps.Compile.compile/2
    (elixir 1.17.3) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
    (mix 1.17.3) lib/mix/tasks/deps.compile.ex:77: Mix.Tasks.Deps.Compile.compile/2
    (mix 1.17.3) lib/mix/tasks/deps.loadpaths.ex:87: Mix.Tasks.Deps.Loadpaths.deps_check/2
    (mix 1.17.3) lib/mix/tasks/deps.loadpaths.ex:48: Mix.Tasks.Deps.Loadpaths.run/1
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.17.3) lib/mix/tasks/loadpaths.ex:37: Mix.Tasks.Loadpaths.run/1
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.17.3) lib/mix/tasks/compile.ex:153: Mix.Tasks.Compile.run/1
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (language_server 0.25.0) lib/language_server/build.ex:442: ElixirLS.LanguageServer.Build.run_mix_compile/1
    (language_server 0.25.0) lib/language_server/build.ex:80: anonymous fn/3 in ElixirLS.LanguageServer.Build.build/3
    (stdlib 6.2) timer.erl:595: :timer.tc/2

I've tried resolving this following this comment: JakeBecker/elixir-ls#71 (comment)

but then ElixirLS stopped starting at all, getting the following error:

Running /Users/anks/.vscode/extensions/jakebecker.elixir-ls-0.27.1/elixir-ls-release/launch.sh
Preferred shell is zsh, relaunching
Looking for asdf install
asdf executable found at /opt/homebrew/bin/asdf. Setting ASDF_DIR=/opt/homebrew/opt/asdf/libexec and adding /opt/homebrew/opt/asdf/libexec/shims to PATH.
[Error - 16:30:31] Server process exited with code 1.
[Error - 16:30:31] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 16:30:31] Connection to server got closed. Server will restart.
true
[Error - 16:30:31] ElixirLS - api client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 

I've then checked ps axu | grep elixir and it no longer produces a process with -extra /Users/anks/.vscode/extensions/jakebecker.elixir-ls-0.27.1/elixir-ls-release/launch.exs

Downgrading to 0.26.4 fixes the connection problem (extension shows in the ps axu | grep elixir, but gets me back to this error (plus Go to definition no longer works):

===> Compiling src/rabbit_heartbeat.erl failed
rabbit_heartbeat.erl:22:39: syntax error before: 'maybe'

rabbit_heartbeat.erl:20:2: type heartbeaters() undefined
rabbit_heartbeat.erl:32:13: type heartbeaters() undefined
rabbit_heartbeat.erl:38:13: type heartbeaters() undefined
rabbit_heartbeat.erl:49:21: type heartbeaters() undefined
rabbit_heartbeat.erl:50:22: type heartbeaters() undefined

[Error - 18:22:12] Process #PID<0.437.0> raised an exception
** (Mix.Error) Could not compile dependency :rabbit_common, "/Users/anks/.asdf/installs/elixir/1.16.2-otp-26/.mix/elixir/1-16/rebar3 bare compile --paths /Users/anks/projects/integrations/.elixir_ls/build/test/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile rabbit_common --force", update it with "mix deps.update rabbit_common" or clean it with "mix deps.clean rabbit_common"
    (mix 1.16.2) lib/mix.ex:580: Mix.raise/2
    (mix 1.16.2) lib/mix/tasks/deps.compile.ex:306: Mix.Tasks.Deps.Compile.do_command/5
    (mix 1.16.2) lib/mix/tasks/deps.compile.ex:211: Mix.Tasks.Deps.Compile.do_rebar3/2
    (mix 1.16.2) lib/mix/tasks/deps.compile.ex:93: anonymous fn/4 in Mix.Tasks.Deps.Compile.compile/2
    (elixir 1.16.2) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (mix 1.16.2) lib/mix/tasks/deps.compile.ex:77: Mix.Tasks.Deps.Compile.compile/2
    (mix 1.16.2) lib/mix/tasks/deps.loadpaths.ex:87: Mix.Tasks.Deps.Loadpaths.deps_check/2
    (mix 1.16.2) lib/mix/tasks/deps.loadpaths.ex:48: Mix.Tasks.Deps.Loadpaths.run/1
    (mix 1.16.2) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.16.2) lib/mix/tasks/loadpaths.ex:37: Mix.Tasks.Loadpaths.run/1
    (mix 1.16.2) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.16.2) lib/mix/tasks/compile.ex:153: Mix.Tasks.Compile.run/1
    (mix 1.16.2) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
    (language_server 0.26.2) lib/language_server/build.ex:441: ElixirLS.LanguageServer.Build.run_mix_compile/1
    (language_server 0.26.2) lib/language_server/build.ex:80: anonymous fn/3 in ElixirLS.LanguageServer.Build.build/3
    (stdlib 6.2) timer.erl:595: :timer.tc/2

I have 2 projects with different asdf setups from .tool-versions (I actually have more, but tested only on those 2)

One:

elixir          1.16.2-otp-26
erlang          26.2.3

Second:

elixir          1.17.3-otp-26
erlang          26.2.5.6

I've reinstalled Elixir and Erlang in one of the projects, to no avail.
fetchDeps is set to false

I'm on Apple M1 Pro with Sonoma 14.4. I have the same issue on VSCode and Cursor.

Are there any other steps I could follow to resolve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions