Closed deybhayden closed 6 years ago
The debugger can't handle NIFs, so you'll need to exclude modules with NIFs in your launch configuration. Try adding the option "excludeModules": ["Bcrypt.Base"]
in launch.json
.
I just tried it. You actually need to do "excludeModules": [":bcrypt_nif"]
.
Thank you - your first suggestion worked in that the server started, but :bcrypt_nif
doesn't. It looked like my phoenix server was running, but I couldn't actually hit the localhost url though.
Hm. Being unable to hit the Phoenix endpoint may be unrelated to the NIF issue. Can you confirm whether you can debug it without the bcrypt library?
Aha, think I got it. I had to take out "startApps" from my phx.server command. I think bcrypt exclusion worked - but then after the server started, vscode froze, then I got Debug adapter process has terminated unexpectedly
.
Ah, yeah, startApps
is required for Phoenix tests but breaks Phoenix server. It's tricky!
Hm. Sorry for continuing to open and close this issue. I'm not properly awake yet.
Debugging the silent debugger failures is a pain. Can you post your code somewhere for me to look at?
I think you can close it one more time - our app has a configuration for starting the webpack dev server as well, and I was launching it too in the debugger. When I turned that off, it started working š . I'm not sure if that's a common practice or not, but we do something like BUILD_CLIENT=true mix phx.server
to kick off a webpack server proc. Think that threw a wrench in everything.
Are you launching webpack via the watchers
section of your Phoenix config? It'd be good to know if that breaks the debugger.
Yes:
watchers = case {System.get_env("BUILD_CLIENT"), IEx.started?} do
{build?, _} when build? in [nil, false] -> []
{_, true} -> ["npm": ["run", "start-iex", cd: asset_dir]]
{_, _} -> ["npm": ["start", cd: asset_dir]]
end
Got it. Thanks!
Thank you! Great project, love actually being able to run a debugger for Elixir! š
Sorry to do this but, I have a similar but different situation. I get this error when my code attempts to use bcrypt.
(exit) an exception was raised: (ErlangError) Erlang error: :not_loaded :erlang.nif_error(:not_loaded) (comeonin) Elixir.Comeonin.Bcrypt.erl:142: Comeonin.Bcrypt.bf_init/3 (comeonin) Elixir.Comeonin.Bcrypt.erl:166: Comeonin.Bcrypt.bcrypt/4 (comeonin) Elixir.Comeonin.Bcrypt.erl:159: Comeonin.Bcrypt.hashpw/2 (comeonin) Elixir.Comeonin.Bcrypt.erl:118: Comeonin.Bcrypt.checkpw/2
I tried both types of excludeModules, deleted .elixir_ls and _build. rebuilt it, same thing. Any ideas? Its a phoenix project using brunch.
I should add though that its an umbrella phoenix web app. I created a task: "phx.server" to start it using the umbrella dir as the "projectDir".
Thankyou for the work you've put into this btw, was amazed to see variables in an interactive editor and not iex.
I upgraded my comeonin dependancy to v4.0 and got past this error. Got another issue but I'll try to work it through first this time. Thanks anyway.
Running the default mix task (just compiling) results in the error below for my project. I have Erlang 20 and can run the same commands successfully from the command line. Any suggestions for this? Found another similar issue for IntelliJ - https://github.com/KronicDeth/intellij-elixir/issues/891 - he switched crypto packages, but I'd rather not do that for just editor tooling? Thanks!