Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alappe opened this issue Jun 5, 2024 · 0 comments
Open

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

alappe opened this issue Jun 5, 2024 · 0 comments

Comments

@alappe
Copy link

alappe commented Jun 5, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant