ElixirLS crashing on Mac M2

I suddenly started having problems with ElixirLS crashing in Visual Studio Code. I ran Elixir 1.15.2 and OTP-26, and have tried to upgrade to Elixir 1.16.1, with no luck.

I have installed erlang 26.2.2 and elixir 1.16.1-otp-16 with asdf. I have tried downgrading the ElixirLS version, uninstalled it, restarted, and reinstalled, and deleted the .elixir_ls folder. Nothing work, and the .elixir_ls folder has not reappeared. I have also tried to remove and reinstall elixir and erlang.

The errors I get are

Running /Users/username/.vscode/extensions/jakebecker.elixir-ls-0.19.0/elixir-ls-release/launch.sh
Preferred shell is zsh, relaunching
Looking for ASDF install
ASDF install found in /opt/homebrew/opt/asdf/libexec/asdf.sh, sourcing
Installing ElixirLS release v0.19.0
Running in /Users/username/Coding/myProject
Install complete
[Info  - 11:52:37] Started ElixirLS v0.19.0
[Info  - 11:52:37] Running in /Users/username/Coding/myProject
[Info  - 11:52:37] ElixirLS built with elixir "1.16.1" on OTP "26"
[Info  - 11:52:37] Running on elixir "1.16.1 (compiled with Erlang/OTP 26)" on OTP "26"
[Info  - 11:52:37] Protocols are not consolidated
[Info  - 11:52:37] Elixir sources not found (checking in /home/runner/work/elixir/elixir). Code navigation to Elixir modules disabled.
[Info  - 11:52:37] Received client configuration via workspace/configuration
%{"additionalWatchedExtensions" => ["*_test.exs"], "autoBuild" => true, "autoInsertRequiredAlias" => true, "dialyzerEnabled" => true, "dialyzerFormat" => "dialyxir_long", "dialyzerWarnOpts" => [], "enableTestLenses" => true, "envVariables" => %{}, "fetchDeps" => false, "languageServerOverridePath" => "", "mixEnv" => "test", "mixTarget" => "", "projectDir" => "", "signatureAfterComplete" => true, "suggestSpecs" => true, "trace" => %{"server" => "off"}}
[Error - 11:52:37] Invalid `additionalWatchedExtensions`: ["*_test.exs"]
[Error - 11:52:39] Server process exited with code 1.
[Error - 11:52:39] The ElixirLS - myProject server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Anyone who have experienced this or ideas on how to fix it?

1 Like

Building everything from Elixir itself up from sources, fades out some doubts of platform inconsistencies; asdf is a quite help.

Hey @teatimes as an initial sanity check if you rm -rf .elixir_ls in your project does it help?

2 Likes

Looks like 0.19.0 added extra config validation, ElixirLS now barfs if the extensions don’t begin with a period.

2 Likes

Why would anyone include .exs in additional watched extensions anyway? The server subscribes for changes on .exs and a couple of other standard elixir/erlang extensions by default

Thank you so much, that seems to have solved the issue for me!