lugomateo

lugomateo

ElixirLS stopped working: "Unable to find formatter"

Not sure what happened, elixirLS had been working just fine in multiple projects.

When I try to format an elixir file on save I get the following…
image

I tried deleting the .elixir_ls folder to allow ElixirLS to recompile.
I see the following output:

Running /Users/mateo/.vscode/extensions/jakebecker.elixir-ls-0.17.5/elixir-ls-release/launch.sh
Preferred shell is zsh, relaunching
Looking for ASDF install
ASDF install found in /usr/local/opt/asdf/libexec/asdf.sh, sourcing
Installing ElixirLS release v0.17.5
Running in <my project path>
Install complete
[Info  - 10:44:33 AM] Started ElixirLS v0.17.5
[Info  - 10:44:33 AM] Running in <my project path>
[Info  - 10:44:33 AM] ElixirLS built with elixir "1.14.2" on OTP "25"
[Info  - 10:44:33 AM] Running on elixir "1.14.2 (compiled with Erlang/OTP 25)" on OTP "25"
[Info  - 10:44:33 AM] Protocols are not consolidated
[Info  - 10:44:33 AM] Elixir sources not found (checking in /home/build/elixir). Code navigation to Elixir modules disabled.
[Info  - 10:44:33 AM] Received client configuration via workspace/configuration
%{"additionalWatchedExtensions" => [], "autoBuild" => true, "autoInsertRequiredAlias" => true, "dialyzerEnabled" => true, "dialyzerFormat" => "dialyxir_long", "dialyzerWarnOpts" => [], "enableTestLenses" => false, "envVariables" => %{}, "fetchDeps" => false, "languageServerOverridePath" => "", "mixEnv" => "test", "mixTarget" => "", "projectDir" => "", "signatureAfterComplete" => true, "suggestSpecs" => true, "trace" => %{"server" => "off"}}
[Info  - 10:44:33 AM] Loaded DETS databases in 92ms
[Info  - 10:44:33 AM] Registering for workspace/didChangeConfiguration notifications
[Info  - 10:44:33 AM] client/registerCapability succeeded
[Info  - 10:44:33 AM] Registering for workspace/didChangeWatchedFiles notifications
[Info  - 10:44:33 AM] client/registerCapability succeeded
[Info  - 10:44:33 AM] Starting build with MIX_ENV: test MIX_TARGET: host
[Info  - 10:44:34 AM] Compile took 490 milliseconds
[Info  - 10:44:34 AM] [ElixirLS WorkspaceSymbols] Indexing...
[Info  - 10:44:34 AM] [ElixirLS WorkspaceSymbols] Module discovery complete
[Info  - 10:44:34 AM] [ElixirLS WorkspaceSymbols] 24 callbacks added to index
[Info  - 10:44:35 AM] [ElixirLS WorkspaceSymbols] 247 modules added to index
[Info  - 10:44:36 AM] [ElixirLS WorkspaceSymbols] 422 types added to index
[Info  - 10:44:37 AM] [ElixirLS WorkspaceSymbols] 4868 functions added to index

Then nothing else happens…
And when I try to format on save I see

[Error - 10:44:52 AM] Request textDocument/formatting failed.
  Message: project_not_loaded
  Code: -32603 

Also, I dont ever see a build folder get created in .elixir_ls or any dyalizer_tpm folder for that matter.

Any ideas?

Most Liked

lukaszsamson

lukaszsamson

ElixirLS Core Team

I can reproduce your crash on windows only. The repo works fine on macos. The language server is not crashing, it’s vscode that closes the connection. It looks like another wonderful case od OTP 26 breaking basic stdio like other ones in Not starting on OTP26 · Issue #886 · elixir-lsp/elixir-ls · GitHub

cgraham

cgraham

Just adding in I had this for weeks on latest version of ElixirLS (0.23.1). Elixir 1.17.2, OTP 27. Tried installing older versions, uninstalling, reinstalling. Nothing worked. Eventually I uninstalled, trashed the .elixir_ls folder, reinstalled an older version and then upgraded Elixir LS and it worked!

7stud

7stud

I was getting the “Unable to find formatter” error in an umbrella app (auction_umbrella in “Elixir in Action 1.4”), but I really didn’t care if my code was formatted according to some spec. However, when I opened a terminal window in vscode, that blasted error message would popup and cover the output in the terminal window–now the formatter error was a problem! I searched around trying to find a solution–without any success, and finally I just unnistalled ElixirLS in vscode, quit vscode, relaunched vscode, and reinstalled ElixirLS in vscode, and now the error is gone. We’ll see if that remains the case.

Where Next?

Popular in Questions Top

skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Lily
In templates/appointment/index.html.eex: &lt;%= for appointment &lt;- @appointments do %&gt; &lt;tr&gt; &lt;td&gt;&lt;%= appoi...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
nobody
Hi! In PHP: $SERVER['SERVERADDR'] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 47849 226
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

We're in Beta

About us Mission Statement