Mazyod
Hello,
I have an issue with ElixirLS running in VSCode if a Git dependency is present. I tried to create a fresh project with a single git dependency, and immediately reproduced the problem. I am not sure how to debug this further, as the error message is very cryptic. Any help appreciated.
Below are the logs of a new elixir project, using latest Elixir version, and simply adding a single git dependency.
defmodule Alchemist.MixProject do
use Mix.Project
def project do
[
app: :alchemist,
version: "0.1.0",
elixir: "~> 1.17",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:jason, github: "michalmuskala/jason"}
]
end
end
➜ alchemist git:(main) ✗ iex
Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace]
Interactive Elixir (1.17.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> System.cmd("git", ["--git-dir=.git", "config", "remote.origin.url"], [cd: "/Users/mazyod/projects/new-elixir/alchemist/deps/jason"])
{"https://github.com/michalmuskala/jason.git\n", 0}
Running /Users/mazyod/.vscode/extensions/jakebecker.elixir-ls-0.22.1/elixir-ls-release/launch.sh
Preferred shell is zsh, relaunching
Looking for ASDF install
ASDF not found
Looking for mise executable
mise not found
Looking for rtx executable
rtx not found
Looking for vfox executable
vfox not found
Installing ElixirLS release v0.22.1
Running in /Users/mazyod/projects/new-elixir/alchemist
Install complete
[Info - 9:02:37 AM] Started ElixirLS v0.22.1
[Info - 9:02:37 AM] Running in /Users/mazyod/projects/new-elixir/alchemist
[Info - 9:02:37 AM] ElixirLS built with elixir "1.17.2" on OTP "26"
[Info - 9:02:37 AM] Running on elixir "1.17.2 (compiled with Erlang/OTP 26)" on OTP "26"
[Info - 9:02:37 AM] Protocols are not consolidated
[Info - 9:02:37 AM] Elixir sources not found (checking in /private/tmp/elixir-20240706-7373-erwccq/elixir-1.17.2). Code navigation to Elixir modules disabled.
[Info - 9:02:37 AM] Received client configuration via workspace/configuration
%{"additionalWatchedExtensions" => [], "autoBuild" => true, "autoInsertRequiredAlias" => true, "dialyzerEnabled" => true, "dialyzerFormat" => "dialyxir_long", "dialyzerWarnOpts" => [], "enableTestLenses" => false, "envVariables" => %{"PATH" => "/opt/homebrew/bin"}, "fetchDeps" => false, "incrementalDialyzer" => true, "languageServerOverridePath" => "", "mixEnv" => "test", "mixTarget" => "", "projectDir" => "", "signatureAfterComplete" => true, "suggestSpecs" => true, "trace" => %{"server" => "off"}}
[Info - 9:02:37 AM] Registering for workspace/didChangeConfiguration notifications
[Info - 9:02:37 AM] Starting build with MIX_ENV: test MIX_TARGET: host
[Info - 9:02:37 AM] client/registerCapability succeeded
[Info - 9:02:37 AM] Registering for workspace/didChangeWatchedFiles notifications
[Info - 9:02:37 AM] client/registerCapability succeeded
[Info - 9:02:37 AM] Loaded DETS databases in 17ms
[Error - 9:02:37 AM] Process #PID<0.255.0> raised an exception
** (ErlangError) Erlang error: :enoent
(elixir 1.17.2) lib/system.ex:1114: System.cmd("git", ["--git-dir=.git", "config", "remote.origin.url"], [cd: "/Users/mazyod/projects/new-elixir/alchemist/deps/jason"])
(mix 1.17.2) lib/mix/scm/git.ex:312: Mix.SCM.Git.get_rev_info/0
(mix 1.17.2) lib/mix/scm/git.ex:75: anonymous fn/2 in Mix.SCM.Git.lock_status/1
(elixir 1.17.2) lib/file.ex:1665: File.cd!/2
(mix 1.17.2) lib/mix/dep.ex:425: Mix.Dep.check_lock/1
(elixir 1.17.2) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
(mix 1.17.2) lib/mix/tasks/deps.loadpaths.ex:76: Mix.Tasks.Deps.Loadpaths.deps_check/2
(mix 1.17.2) lib/mix/tasks/deps.loadpaths.ex:48: Mix.Tasks.Deps.Loadpaths.run/1
(mix 1.17.2) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.17.2) lib/mix/tasks/loadpaths.ex:37: Mix.Tasks.Loadpaths.run/1
(mix 1.17.2) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.17.2) lib/mix/tasks/compile.ex:153: Mix.Tasks.Compile.run/1
(mix 1.17.2) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(language_server 0.22.1) lib/language_server/build.ex:442: ElixirLS.LanguageServer.Build.run_mix_compile/1
(language_server 0.22.1) lib/language_server/build.ex:80: anonymous fn/3 in ElixirLS.LanguageServer.Build.build/3
(stdlib 5.2.3) timer.erl:270: :timer.tc/2
Received $/cancelRequest for unknown request id: 8
Received $/cancelRequest for unknown request id: 11
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
undeadlol1
I have the same problem. No amount of googling helped me to solve it.
The only workaround I could find is to set
"elixirLS.autoBuild": false,in the VS Code user settings.jdiago
What happens if you delete the
.elixir_lsdirectory and restarted vs code? That’s what I tend to do when elixir ls freaks out about deps.dimitarvp
I was about to suggest the same as @jdiago, but not only delete the
.elixir_lsdirectory:After that completes, start your IDE and wait for ElixirLS to rebuild its cache.
Mazyod
For me, I did all the above, and then some. Reinstalling the extensions, VSCode, etc. It was a persistent issue and gave up in the end since as shared, googling led me to nowhere.
Interested to try @undeadlol1 workaround soon
jdiago
The OP was from last year so I thought I’d try to reproduce it. I just did:
mix new alchemistcd alchemistcode .{:jason, github: "michalmuskala/jason"}todepsmix deps.getin terminal (not in the vs code terminal)Elixir LS complained after step 4 but worked fine after step 5 without restarting vs code.
The only thing in my vs code config that could be the difference is
"elixirLS.fetchDeps": falsedimitarvp
Yes, many language servers have difficulty working if the dependencies have not been fetched. Always do that before starting the LS.
NobbZ
From the error it looks as if you are on macos…
Does the problem persist if you start VScode from a terminal rather than your laincher?
Mazyod
Personally, I almost never use the Launcher, always use the CLI.
I just tried it with the latest ElixirLS 0.27.1, Elixir 1.18.3 and the problem still happens exactly like before. Trying the disable autoBuild workaround finally did the trick.
Then.. Decided to ask Claude for its opinion, and it suggested checking if
gitor.gitare unavailable, since that’s what:enoentwas referencing, File Not Found.Based on that, tried installing git from homebrew, and linking it. Launched VS Code with
autoBuildtrue, and all works again. Close VSCode, uninstallgitfrom homebrew, open VSCode one more time, get the same error as before. Not sure why ElixirLS doesn’t “see” macOS’s git binary in/usr/bin/git?NobbZ
This is exactly why I proposed to try from terminal.
It is a known issue that applications started from the GUI will not see the same
PATH(and other environment variables) as those started from a terminal/shell.I haven’t used VScode in a while, and even less did I use the debugging facilities… Years ago, I debugged a similar issue with a coworker (on Linux though and not elixir LS related), and we eventually checked the
PATHenvironment variable and have seen significant discrepancies between the one defined in the shell and the one as seen by VScode from launcher.There we mitigated by using
/etc/environment.dto “correct” the PATH.Though sadly I do not remember anymore how we checked the
PATHas seen by VScode back then… Also MacOS does not have an equivalent of/etc/environment.dAFAIR.undeadlol1
I solved the problem on my side by addressing several issues. I’m not sure which single step fixed it for me, but I had to deal with two main problems:
VS Code ElixirLS configuration (especially the PATH property)
A broken ASDF Elixir installation (likely related to SSL issues)
The problem was most likely with my PATH configuration. If your project doesn’t use ASDF, you might be able to skip the ASDF steps.
Since I’m new to Elixir I don’t know what specific steps helped me thus I will list all of them:
Uninstall the ElixirLS extension from VS Code.
Remove build artifacts:
Run this command in your project directory:
It seems that uninstalling ASDF itself does not remove the Elixir plugin. Make sure that running
asdf listshows no versions installed.Uninstall ASDF.
Reinstall ASDF (I used brew
install asdfon macOS).Install the ASDF plugins for Elixir and Erlang:
Run asdf install to install the versions of Erlang and Elixir.
Fix SSL problems:
Install the necessary SSL dependencies:
Then, set the proper SSL options:
Comment out all custom ElixirLS configurations in VS Code (you can leave the formatter configuration intact). In my case, the PATH option was likely causing the problems.
Install the ElixirLS extension in VS Code again.
Restart VS Code (or use the “Restart Extension Host” command from the command palette).
Wait a little while for Elixir compilation to complete (there is no visible indication that compilation is running).
Everything should be working now.