Skip to content

Error "[Next LS] Runtime for folder … failed to initialize" #513

@alappe

Description

@alappe

Running v0.22.8 I get this in the lsp log of my neovim: "[Next LS] Runtime for folder xy failed to initialize" happening for every project.

I built next-ls from source and started it manually to see what exactly fails. The spawned port for the following command failed with {:error, :portdown}: /Users/nd/src/next-ls/_build/dev/lib/next_ls/priv/cmd /Users/nd/.asdf/installs/elixir/1.16.2/bin/elixir --no-halt --sname nextls-runtime-1717491548466058959 --cookie LYFPZNMONKRMJBOFPKDE -S mix loadpaths --no-compile

Executing that by hand, I get:

** (SyntaxError) invalid syntax found on /Users/nd/.asdf/shims/mix:11:57:
    error: syntax error before: "$@"
    │
 11 │ exec /opt/homebrew/opt/asdf/libexec/bin/asdf exec "mix" "$@" # asdf_allow: ' asdf '
    │                                                         ^
    │
    └─ /Users/nd/.asdf/shims/mix:11:57
    (elixir 1.16.2) lib/code.ex:1489: Code.require_file/2

Changing the command to /Users/nd/src/next-ls/_build/dev/lib/next_ls/priv/cmd elixir --no-halt --sname nextls-runtime-1717491548466058959 --cookie LYFPZNMONKRMJBOFPKDE -S mix loadpaths --no-compile (using the elixir shim instead of the full path), it works.

I think it's an issue in my environment and read through asdf-vm/asdf-elixir#111 and adjent issues but I can't find a good solution (except the change mentioned above), so I wonder if somebody else has solved this better?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions