torrocar

torrocar

Elixir-LS fails in neovim

Hi all,

I have configured my neovim according to this thread - thanks for the awesome work on that one, btw!
As I am working on an Arch-based Linux system (Artix, to be precise), I had installed the language server from the AUR, where the package version 0.13.0 worked nicely.
However, after upgrading to package version 0.14.6, every time I open an elixir file I’ll get the message Client 1 quit with exit code 1 and signal 0 after a few seconds. Restarting the server with :LspStart will result in the same message.
I have tried installing elixir-ls via mason as well, which will display the same error. Downgrading to v013.0, which worked formerly, also doesn’t help.
I even created a new user, set up neovim from scratch for him, and ran into the same problem. This is also true when I use the exact init.lua-file given in the tutorial - with the path to elixir-ls set correctly, of course.

Checking the lsp.log reveals the following error, which unfortunately I can’t make much of:

[START][2023-06-15 13:47:58] LSP logging initiated
[ERROR][2023-06-15 13:47:58] .../vim/lsp/rpc.lua:734	"rpc"	"/home/torro/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"Runtime terminating during boot ({badarg,[{io,put_chars,[standard_err"
[ERROR][2023-06-15 13:47:58] .../vim/lsp/rpc.lua:734	"rpc"	"/home/torro/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"or,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})\r\n"
[ERROR][2023-06-15 13:47:58] .../vim/lsp/rpc.lua:734	"rpc"	"/home/torro/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"\r\nCrash dump is being written to: erl_crash.dump..."
[ERROR][2023-06-15 13:47:59] .../vim/lsp/rpc.lua:734	"rpc"	"/home/torro/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"done\r\n"

I’d appreciate any help or pointers where to continue searching a solution!

Thank you for your trouble!

Marked As Solved

TunkShif

TunkShif

BTW, I’m an ArchLinux user, too. The erlang package from arch official repo has been updated to 26 recently. If you’re using pacman to update all software packages to the latest version, including erlang, then it can break elixir-ls. I’ve encountered the same issue a few days ago. I’d recommend you use asdf to manage different erlang/elixir versions. You can install it from AUR under the asdf-vm package name.

Also Liked

lukaszsamson

lukaszsamson

ElixirLS Core Team

ElixirLS 0.15.1 with support for OTP 26.0.2+ is out

dimitarvp

dimitarvp

I am using Elixir 1.14.5 and Erlang 25.3.2.2 and compiling ElixirLS locally with those versions, I use LunarVim with it and have no problems.

I am not keeping up super closely with all the developments but I am seeing increased reports on the forum that people have issues with Erlang/OTP 26 so I’d hold on to 25 for the time being.

dimitarvp

dimitarvp

I don’t use Mason’s installed ElixirLS. I have it locally and update it from GitHub once every 24h and build it like so (this is a snippet from my own homemade “update my machine” script, hence the pushd and popd commands):

(
  pushd ~/bin/elixir-ls &&
  git reset --hard HEAD &&
  git pull &&
  mix deps.get &&
  MIX_ENV=prod mix compile
  MIX_ENV=prod mix elixir_ls.release &&
  popd || return
)

I also make sure it uses the latest stable combo of Elixir and Erlang. I use asdf local for that, though maybe that’s not optimal.

Then I have this in my LunarVim’s init file:

local root_pattern = require("lspconfig").util.root_pattern

require 'lspconfig'.elixirls.setup {
  filetypes = { "elixir", "eelixir", "heex", "surface" },
  root_dir = root_pattern("mix.exs", ".git") or vim.loop.os_homedir(),
  cmd = { "/Users/dimi/bin/elixir-ls/release/language_server.sh" },
}

Though I should probably take another look at the filetypes.

TunkShif

TunkShif

Which Erlang/OTP version are you using? elixir-ls seems not working properly with OTP 26 from my test. Try downgrade to OTP 25 and recompile elixir-ls.

dimitarvp

dimitarvp

I don’t use all of them but those that I use: yes, they still work.

Yep. You can override each separate LSP without affecting anything else.

Where Next?

Popular in Questions Top

openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

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
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New

We're in Beta

About us Mission Statement