Language server issue in emacs - Unable to find installed server supporting this file / elp

I have been trying to get erlang ls working in emacs for a while now without success. Under Visual Studio, erlang-ls works fine, but I just prefer to use emacs. Even with the example file I can’t get things to work.
My situation:

  • Debian 12;
  • Emacs 28.2
  • Erlang installed via kerl under ~/.cache/erls/26.2.1/

The error message I get is:
Unable to find installed server supporting this file. The following servers could be installed automatically:
Auto-complete returns elp

Does anyone perhaps have a working init.el for me?

Are you using eglot or lsp-mode?
I am using eglot and basically I don’t have to configure anything.
Is erlang_ls in your PATH?

|%> which erlang_ls

I have no idea how to set it up with lsp-mode though.

Thanks: turned out to be lsp-mode of which the current version doesn’t work with emacs 28.2.
How do you configure eglot? Any additional packages you find useful?

I use emacs 29.2 which has eglot built in. I literally don’t have any special configuration.
By default it is configured to use erlang_ls. I don’t have any extra packages. I prefer to be vanilla as much as possible. In case you want to use Erlang Language Platform (ELP) from WhatsApp you can do something like:

(add-to-list 'eglot-server-programs
             '(erlang-mode . ("elp" "server")))