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

Can't continue due to errors on dependencies #285

Closed
michaelcaterisano opened this issue Oct 14, 2023 · 15 comments
Closed

Can't continue due to errors on dependencies #285

michaelcaterisano opened this issue Oct 14, 2023 · 15 comments

Comments

@michaelcaterisano
Copy link

michaelcaterisano commented Oct 14, 2023

I'm seeing the following error in the next-ls server logs when starting up Zed. I've tried deleing .elixir-tools and deps, running mix deps.get, reopening Zed, still seeing this error. The app compiles with no issue. I'm using Zed 0.107.6. I'm on Erlang/OTP 25 [erts-13.1.2] and Elixir 1.14.2.

[NextLS] NextLS v0.13.4 has initialized!
[NextLS] Booting runtimes...
[NextLS] Beginning DB migration...
[NextLS] Database is on the latest version: 5
[NextLS] Finished DB migration...
[NextLS] Using `elixir` found at: /Users/me/.asdf/shims/elixir
[NextLS] Connected to node nextls-runtime-1697306638853324875@Michaels-MacBook-Pro
[NextLS] Runtime for folder  is ready...
[NextLS] Unchecked dependencies for environment dev:
* dynasaur (apps/dynasaur)
  the dependency is not available
[NextLS] * mix_audit (Hex package)
  the dependency is not available, run "mix deps.get"
* gen_stage (Hex package)
[NextLS]   the dependency is not available, run "mix deps.get"
* argon2_elixir (Hex package)
  the dependency is not available, run "mix deps.get"
* tasks (apps/tasks)
  the dependency is not available
* middleware (apps/middleware)
[NextLS]   the dependency is not available
[NextLS] * event_consumers (apps/event_consumers)
  the dependency is not available
* support_tool (apps/support_tool)
  the dependency is not available
* telemetry (Hex package)
  the dependency is not available, run "mix deps.get"
* serializers (apps/serializers)
  the dependency is not available
* cowboy (Hex package)
  the dependency is not available, run "mix deps.get"
* api (apps/api)
  the dependency is not available
* phoenix (Hex package)
  the dependency is not available, run "mix deps.get"
* core (apps/core)
  the dependency is not available
* retry (Hex package)
  the dependency is not available, run "mix deps.get"
* dialyxir (Hex package)
  the dependency is not available, run "mix deps.get"
* db (apps/db)
  the dependency is not available
* hackney (Hex package)
  the dependency is not available, run "mix deps.get"
[NextLS] * credo (Hex package)
[NextLS]   the dependency is not available, run "mix deps.get"
* ecto (Hex package)
  the dependency is not available, run "mix deps.get"
* events (apps/events)
  the dependency is not available
* hertz (apps/hertz)
[NextLS]   the dependency is not available
* styler (Hex package)
  the dependency is not available, run "mix deps.get"
* munger (apps/munger)
  the dependency is not available
[NextLS] * seeder (apps/seeder)
[NextLS]   the dependency is not available
* ecto_sql (Hex package)
  the dependency is not available, run "mix deps.get"
* wal_to_elasticsearch (apps/wal_to_elasticsearch)
[NextLS]   the dependency is not available
[NextLS] * httpoison (Hex package)
  the dependency is not available, run "mix deps.get"
* email (apps/email)
  the dependency is not available
[NextLS] Unexpected compiler response: {:error, %{message: "Can't continue due to errors on dependencies", __struct__: Mix.Error, __exception__: true, mix: 1}}

@michaelcaterisano
Copy link
Author

michaelcaterisano commented Oct 14, 2023

This fixed the compilation issue JakeBecker/elixir-ls#71 (comment), but it seems this is necessary every time I restart Zed.

@mhanberg
Copy link
Collaborator

Might be a zed root path detection issue for umbrella apps, I'll have to play around with it later and report upstream if I'm correct.

@mhanberg
Copy link
Collaborator

I played around with an umbrella app, it seems to work on my end.

I am curious to know if there is anything special about your umbrella app that is different from a basic one?

@nicolasferraro
Copy link

nicolasferraro commented Oct 18, 2023

FWIW this also happens to me on vscode and elixir 1.15.5 after installing NextLS and disabling ElixirLS.

I'm not on an umbrella app

@mhanberg
Copy link
Collaborator

Can you share the rest of the "specs"?

Elixir, OTP version, how you install them (asdf, brew), OS, CPU arch, etc

@nicolasferraro
Copy link

@mhanberg Yep! Let me know if I'm missing something :)

I'm on a M1 Pro macbook running Ventura 13.1. Elixir and Erlang/OTP are installed through asdf's plugin.

I first tried it out on vscode and it wouldn't download the missing deps (see logs below), then I tried it on zed and it worked perfectly. Not sure what's different between the integrations but since it was able to compile on zed now it works fine on vscode too 🤔 .

> elixir -v
Elixir 1.15.7 (compiled with Erlang/OTP 25)

> erl
Erlang/OTP 25 [erts-13.2] ...

NextLS logs:

[NextLS] NextLS v0.13.5 has initialized!
[NextLS] Booting runtimes...
[NextLS] Beginning DB migration...
[Info  - 3:09:32 PM] [NextLS] Database is on the latest version: 5
[NextLS] Finished DB migration...
[NextLS] Using `elixir` found at: /Users/nico/.asdf/shims/elixir
[NextLS] Connected to node nextls-runtime-1697652572210874417@MacBook-Pro
[NextLS] Runtime for folder my-app is ready...
[NextLS] Unchecked dependencies for environment dev:
Unchecked dependencies for environment dev:
* grpcbox (Hex package)
* grpcbox (Hex package)
  the dependency is not available, run "mix deps.get"
* file_system (Hex package)
  the dependency is not available, run "mix deps.get"
  the dependency is not available, run "mix deps.get"
* connection (Hex package)

@michaelcaterisano
Copy link
Author

bump

Any progress on this?

@mhanberg
Copy link
Collaborator

bump

Any progress on this?

Can you answer the question I asked previously:

I am curious to know if there is anything special about your umbrella app that is different from a basic one?

@michaelcaterisano
Copy link
Author

Not that I'm aware of. Anything specific you have in mind that I can answer?

mhanberg added a commit to jjcarstens/next-ls that referenced this issue Feb 28, 2024
mhanberg added a commit to jjcarstens/next-ls that referenced this issue Feb 28, 2024
mhanberg added a commit to jjcarstens/next-ls that referenced this issue Feb 28, 2024
mhanberg added a commit to jjcarstens/next-ls that referenced this issue Feb 28, 2024
mhanberg added a commit that referenced this issue Feb 28, 2024
@mhanberg
Copy link
Collaborator

Would you mind updating to 0.19.1 and trying it out again?

I've introduced a new feature that will detect when your deps have changed since you opened the editor (like if you change branches, etc) and then prompt you with a message to ask if you want it to fetch deps again and restart the internal runtime.

I tested in Zed and it seems to work, would you mind testing on your end to see if it helps with the issues you were seeing?

@mattbaker
Copy link

Also seeing issues with an umbrella in 0.19.1. I saw similar messages to those in this thread prior to updating next_ls. After update, I'm still having trouble.

Logs excerpt that may help 🤞 (umbrella app names redacted):

[NextLS] Connected to node nextls-runtime-1709771229246617144@Q0YJVVX2HN
[NextLS] Runtime for folder  is ready...
[NextLS] Unchecked dependencies for environment dev:
* XXXX1 (apps/XXXX1)
  the dependency is not available
[NextLS] Runtime for folder  failed to initialize
[NextLS] * XXXX2 (apps/XXXX2)
  the dependency is not available
* XXXX3 (apps/XXXX3)
  the dependency is not available
* XXXX4 (apps/XXXX4)
  the dependency is not available
* XXXX5 (apps/XXXX5)
  the dependency is not available
* XXXX6 (apps/XXXX6)
  the dependency is not available
* XXXX7 (apps/XXXX7)
  the dependency is not available
[NextLS] * XXXX8 (apps/XXXX8)
  the dependency is not available
[NextLS] The runtime for  has successfully shut down.
[NextLS] Bad RPC call to node nextls-runtime-1709771229246617144@Q0YJVVX2HN: :nodedown

I'm wondering if next_ls is having issues with inter-app deps? e.g.

defp deps do
    [
      {:an_app_in_the_umbrella_i_depend_on, in_umbrella: true},
      {:another_app_in_the_umbrella_i_depend_on, in_umbrella: true},
      # ...
     ]
end

@mhanberg
Copy link
Collaborator

mhanberg commented Mar 7, 2024

Thanks for the report!

I have a new hypothesis, will be investigating over the coming days.

@mhanberg
Copy link
Collaborator

I think I was able to reproduce this in the wild, but not in a test. I haven't tested my suspicion yet but I'm hopeful

@mhanberg
Copy link
Collaborator

I believe #401 should close out this issue, I will likely release it in v0.20.2, please update and let me know if you can still reproduce.

I'll close the issue if I don't hear back in a while, but feel free to comment and I'll re-open

@mattbaker
Copy link

Just installed it last night, I was able to use find references (wow is it fast) so it seems to be up and running, I’ll file a new ticket if I hit any other issues

@mhanberg mhanberg closed this as completed Apr 1, 2024
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

4 participants