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

Unable to debug a brand new Phoenix project #211

Closed
superchris opened this issue Apr 18, 2020 · 2 comments
Closed

Unable to debug a brand new Phoenix project #211

superchris opened this issue Apr 18, 2020 · 2 comments

Comments

@superchris
Copy link

Environment

  • Elixir & Erlang versions (elixir --version):
    Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
    Elixir 1.10.1 (compiled with Erlang/OTP 22)
  • Operating system: Ubuntu running under WSL2
  • Editor or IDE name (e.g. Emacs/VSCode): VSCode
  • LSP Client name: ElixirLS Fork: Elixir support and debugger

Description

I created a brand new phoenix project and attempted to debug tests from VSCode using the default launch.json for mix test. Here's the output:

Started ElixirLS Fork debugger v0.3.2
Elixir version: "1.10.1 (compiled with Erlang/OTP 22)"
Erlang version: "22"
** Invalid beam file or no abstract code: 'Elixir.DebugTestWeb.PageControllerTest'
** Invalid beam file or no abstract code: 'Elixir.DebugTestWeb.ErrorViewTest'
** Invalid beam file or no abstract code: 'Elixir.DebugTestWeb.LayoutViewTest'
** Invalid beam file or no abstract code: 'Elixir.DebugTestWeb.PageViewTest'
(Debugger) Task failed because an exception was raised:
** (UndefinedFunctionError) function DebugTestWeb.PageViewTest.ex_unit/0 is undefined (module DebugTestWeb.PageViewTest is not available)
DebugTestWeb.PageViewTest.ex_unit()
(ex_unit 1.10.1) lib/ex_unit/runner.ex:118: ExUnit.Runner.run_module/2
13:37:16.898 [error] Process #PID<0.998.0> raised an exception
** (UndefinedFunctionError) function DebugTestWeb.PageViewTest.ex_unit/0 is undefined (module DebugTestWeb.PageViewTest is not available)
DebugTestWeb.PageViewTest.ex_unit()
(ex_unit 1.10.1) lib/ex_unit/runner.ex:118: ExUnit.Runner.run_module/2
13:37:16.899 [error] GenServer #PID<0.994.0> terminating
** (UndefinedFunctionError) function DebugTestWeb.PageViewTest.ex_unit/0 is undefined (module DebugTestWeb.PageViewTest is not available)
DebugTestWeb.PageViewTest.ex_unit()
(ex_unit 1.10.1) lib/ex_unit/runner.ex:118: ExUnit.Runner.run_module/2
Last message: {:EXIT, #PID<0.988.0>, {:undef, [{DebugTestWeb.PageViewTest, :ex_unit, [], []}, {ExUnit.Runner, :run_module, 2, [file: 'lib/ex_unit/runner.ex', line: 118]}]}}

@superchris
Copy link
Author

I didn't catch that this was already a known issue. For others that might chance upon this, I was able to install elixir from master (1.11.0-dev) using asdf and the debugger worked for me.

@axelson
Copy link
Member

axelson commented Apr 19, 2020

Glad you figured it out! For reference here is the other issue: #158

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

2 participants