fahani

fahani

Hello!

I am a PHP and Go developer. This weekend I wanted to give it a try to Elixir & Phoenix but I run into some debugging issues that I am not able to resolve.

These are the versions of my current OS and tools:

  • Ubuntu 24.04.1 LTS
  • asdf v0.14.1-f00f759
  • Erlang 27.1
  • Elixir 1.17.3
  • Mix 1.17.3
  • IntelliJ IDEA 2024.2.2 (Ultimate Edition) Build #IU-242.22855.74, built on September 18, 2024
  • KronicDeth/intellij-elixir v19.0.1

I created a hello_elixir Phoenix project mix phx.new hello_elixir, I configured the db mix ecto.create and I started the app mix phx.server. I went to http://localhost:4000 and the app loaded correctly, here is the terminal output :

[info] Running HelloElixirWeb.Endpoint with Bandit 1.5.7 at 127.0.0.1:4000 (http)
[info] Access HelloElixirWeb.Endpoint at http://localhost:4000
[watch] build finished, watching for changes...

Rebuilding...

Done in 451ms.
[info] GET /
[debug] Processing with HelloElixirWeb.PageController.home/2
  Parameters: %{}
  Pipelines: [:browser]
[info] Sent 200 in 120ms

I made sure the app could run using Interactive Elixir iex -S mix phx.server, it ran correctly.

I went ahead and opened the project in the IDE and configure the Project Structure, here some screenshots (as a new user in the forum it won’t let me paste image directly):

Here is the debug configuration I tried:

Result of running the configuration:

/home/nico/.asdf/installs/erlang/27.1/bin/erl -pa /home/nico/.asdf/installs/erlang/27.1/lib/observer-2.16/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/tftp-1.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/kernel-10.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/megaco-4.6/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/wx-2.4.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/parsetools-2.6/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/os_mon-2.10/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ssh-5.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/mnesia-4.23.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/tools-4.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/stdlib-6.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/inets-9.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/snmp-5.17/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/diameter-2.4.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/edoc-1.3.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/asn1-5.3.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/odbc-2.15/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/syntax_tools-3.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/crypto-5.5.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/public_key-1.16.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/eldap-1.2.13/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/runtime_tools-2.1.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/eunit-2.9.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/debugger-5.4/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/erts-15.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/xmerl-2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/et-1.7.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/sasl-4.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ssl-11.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/common_test-1.27.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/compiler-8.5.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/erl_interface-5.5.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/jinterface-1.14.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ftp-1.2.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/dialyzer-5.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/reltool-1.0.1/ebin iex -S mix -name debuggeda68c5c05-5494-44b7-9ad8-8364f3aeb56a@127.0.0.1 -setcookie a68c5c05-5494-44b7-9ad8-8364f3aeb56a -eval application:ensure_all_started(elixir) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir10/debugger/lib/intellij_elixir/debugger/server.ex\">>) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir10/debugger/lib/intellij_elixir/debugged.ex\">>) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir10/debugger/lib/mix/tasks/intellij_elixir/debug.ex\">>) -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/elixir/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/ex_unit/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/iex/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/mix/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/logger/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/eex/ebin -noshell -s elixir start_cli -elixir ansi_enabled true -extra /home/nico/.asdf/installs/elixir/1.17.3/bin/mix do intellij_elixir.debug, phx.server
Error! Failed to load module 'mix' because it cannot be found.
Make sure that the module name is correct and that its .beam file
is in the code path.

Runtime terminating during boot ({undef,[{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
  • Unable to connect when going to http://localhost:4000/

Followed this Medium article or this post to create the debug configuration

If I run the configuration without erl arguments iex -S mix, this is the result:

/home/nico/.asdf/installs/erlang/27.1/bin/erl -pa /home/nico/.asdf/installs/erlang/27.1/lib/observer-2.16/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/tftp-1.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/kernel-10.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/megaco-4.6/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/wx-2.4.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/parsetools-2.6/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/os_mon-2.10/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ssh-5.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/mnesia-4.23.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/tools-4.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/stdlib-6.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/inets-9.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/snmp-5.17/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/diameter-2.4.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/edoc-1.3.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/asn1-5.3.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/odbc-2.15/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/syntax_tools-3.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/crypto-5.5.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/public_key-1.16.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/eldap-1.2.13/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/runtime_tools-2.1.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/eunit-2.9.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/debugger-5.4/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/erts-15.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/xmerl-2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/et-1.7.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/sasl-4.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ssl-11.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/common_test-1.27.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/compiler-8.5.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/erl_interface-5.5.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/jinterface-1.14.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ftp-1.2.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/dialyzer-5.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/reltool-1.0.1/ebin -name debuggede1784c9d-1d27-42b1-b06d-dbbdabade8eb@127.0.0.1 -setcookie e1784c9d-1d27-42b1-b06d-dbbdabade8eb -eval application:ensure_all_started(elixir) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir3/debugger/lib/intellij_elixir/debugger/server.ex\">>) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir3/debugger/lib/intellij_elixir/debugged.ex\">>) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir3/debugger/lib/mix/tasks/intellij_elixir/debug.ex\">>) -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/elixir/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/ex_unit/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/iex/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/mix/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/logger/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/eex/ebin -noshell -s elixir start_cli -elixir ansi_enabled true -extra /home/nico/.asdf/installs/elixir/1.17.3/bin/mix do intellij_elixir.debug, phx.server
     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 111 │       |> Stream.reject(&(&1 == '.'))
     │                                ~
     │
     └─ /tmp/intellij_elixir3/debugger/lib/intellij_elixir/debugger/server.ex:111:32

Waiting for debugger to attach...

11:57:02.776 [error] GenServer IntelliJElixir.Debugger.Server terminating
** (UndefinedFunctionError) function :int.interpreted/0 is undefined (module :int is not available)
    :int.interpreted()
    /tmp/intellij_elixir3/debugger/lib/intellij_elixir/debugger/server.ex:166: IntelliJElixir.Debugger.Server.handle_call/3
    (stdlib 6.1) gen_server.erl:2381: :gen_server.try_handle_call/4
    (stdlib 6.1) gen_server.erl:2410: :gen_server.handle_msg/6
    (stdlib 6.1) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
Last message (from #PID<9302.4.0>): {:set_breakpoint, HelloElixirWeb.PageController, 7}
State: %IntelliJElixir.Debugger.Server{attached: nil, evaluate_meta_pid_to_froms: %{}}
Client #PID<9302.4.0> is remote on node :"debuggere1784c9d-1d27-42b1-b06d-dbbdabade8eb@127.0.0.1"

The break point is placed under the render in this module:

defmodule HelloElixirWeb.PageController do
  use HelloElixirWeb, :controller

  def home(conn, _params) do
    # The home page is often custom made,
    # so skip the default app layout.
    render(conn, :home, layout: false)
  end
end

Any guidance will be much appreciated.

Thank you!

Showing Posts 1 to 1

fahani

fahani OP

Tagging you @KronicDeth, in case you faced this before :pray:

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
bradley
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
Alvinkariuki
How Can I Optimise Compile Time Dependencies I have been building an elixir application for about 2 years now. Many modules and files ha...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews