Good day, folks!
This is my first day using Elixir (1.14.4 (compiled with Erlang/OTP 25)) & the ElixirLS: Elixir support and debugger VS Code extension (v0.15.3).
When I try running the extension on VS Code (for my code “checkmate_api”), I receive an error about
the module ElixirLS.Shell.Quiet
.
Running /Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/launch.sh
Looking for ASDF install in /usr/local/opt/asdf/libexec/asdf.sh
ASDF found, relaunching in bash shell
Looking for ASDF install in /usr/local/opt/asdf/libexec/asdf.sh
Sourcing ASDF
** (ArgumentError) could not call Module.put_attribute/3 because the module ElixirLS.Shell.Quiet is already compiled
(elixir 1.14.4) lib/module.ex:2504: Module.assert_not_readonly!/2
(elixir 1.14.4) lib/module.ex:2201: Module.__put_attribute__/5
/Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/installer.exs:60: (module)
/Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/installer.exs:59: (file)
[Error - 12:42:28 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 12:42:28 PM] Connection to server got closed. Server will restart.
true
[Error - 12:42:28 PM] ElixirLS - checkmate_api client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
Running /Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/launch.sh
Looking for ASDF install in /usr/local/opt/asdf/libexec/asdf.sh
ASDF found, relaunching in bash shell
Looking for ASDF install in /usr/local/opt/asdf/libexec/asdf.sh
Sourcing ASDF
** (ArgumentError) could not call Module.put_attribute/3 because the module ElixirLS.Shell.Quiet is already compiled
(elixir 1.14.4) lib/module.ex:2504: Module.assert_not_readonly!/2
(elixir 1.14.4) lib/module.ex:2201: Module.__put_attribute__/5
/Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/installer.exs:60: (module)
/Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/installer.exs:59: (file)
[Error - 12:42:30 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 12:42:30 PM] Connection to server got closed. Server will restart.
true
[Error - 12:42:30 PM] ElixirLS - checkmate_api client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
Running /Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/launch.sh
Looking for ASDF install in /usr/local/opt/asdf/libexec/asdf.sh
ASDF found, relaunching in bash shell
Looking for ASDF install in /usr/local/opt/asdf/libexec/asdf.sh
Sourcing ASDF
** (ArgumentError) could not call Module.put_attribute/3 because the module ElixirLS.Shell.Quiet is already compiled
(elixir 1.14.4) lib/module.ex:2504: Module.assert_not_readonly!/2
(elixir 1.14.4) lib/module.ex:2201: Module.__put_attribute__/5
/Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/installer.exs:60: (module)
/Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/installer.exs:59: (file)
[Error - 12:42:32 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 12:42:32 PM] Connection to server got closed. Server will restart.
true
[Error - 12:42:32 PM] ElixirLS - checkmate_api client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 12:42:32 PM] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
Running /Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/launch.sh
Looking for ASDF install in /usr/local/opt/asdf/libexec/asdf.sh
ASDF found, relaunching in bash shell
Looking for ASDF install in /usr/local/opt/asdf/libexec/asdf.sh
Sourcing ASDF
** (ArgumentError) could not call Module.put_attribute/3 because the module ElixirLS.Shell.Quiet is already compiled
(elixir 1.14.4) lib/module.ex:2504: Module.assert_not_readonly!/2
(elixir 1.14.4) lib/module.ex:2201: Module.__put_attribute__/5
/Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/installer.exs:60: (module)
/Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/installer.exs:59: (file)
[Error - 12:42:33 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 12:42:33 PM] Connection to server got closed. Server will restart.
true
[Error - 12:42:33 PM] ElixirLS - checkmate_api client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 12:42:33 PM] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
Running /Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/launch.sh
Looking for ASDF install in /usr/local/opt/asdf/libexec/asdf.sh
ASDF found, relaunching in bash shell
Looking for ASDF install in /usr/local/opt/asdf/libexec/asdf.sh
Sourcing ASDF
** (ArgumentError) could not call Module.put_attribute/3 because the module ElixirLS.Shell.Quiet is already compiled
(elixir 1.14.4) lib/module.ex:2504: Module.assert_not_readonly!/2
(elixir 1.14.4) lib/module.ex:2201: Module.__put_attribute__/5
/Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/installer.exs:60: (module)
/Users/nathangupta/.vscode/extensions/jakebecker.elixir-ls-0.15.3/elixir-ls-release/installer.exs:59: (file)
[Error - 12:42:36 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 12:42:36 PM] The ElixirLS - checkmate_api server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 12:42:36 PM] ElixirLS - checkmate_api client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 12:42:36 PM] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
I’ve been racking my brain trying to understand what’s happening here and this has led to many installs, uninstalls, and reinstalls using homebrew & asdf. When installing elixir via asdf, I’ve noticed that in my root directory of my “users/nathangupta”, we create a hidden directory with an elixir executable:
/Users/nathangupta/.asdf/shims/elixir
and then the versions are added in the “installs” directory.
I’ve also noticed that I have elixir in this directory /usr/local/Cellar/elixir/1.15.2
likely because I did brew install elixir
.
What I don’t understand is why we look for ASDF twice if it’s found the first time, and I’m not sure what’s happening the second time around.
For additional context, this is my ./zshrc file.
if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)"; fi
export PATH="/Library/PostgreSQL/14/bin:$PATH"
export PATH="/usr/local/opt/docker/bin:$PATH"
export PATH="/usr/local/etc/bash_completion.d/docker:$PATH"
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/opt/erlang/bin:$PATH"
export PATH="/usr/local/Cellar/:$PATH"
export LDFLAGS="-L$(brew --prefix openssl)/lib"
export CPPFLAGS="-I$(brew --prefix openssl)/include"
export PATH="/usr/local/opt/erlang@25/bin:$PATH"
export PATH="$PATH:/Users/nathangupta/.local/bin"
. /usr/local/opt/asdf/libexec/asdf.sh