Ripster

Ripster

Intellij-elixir phoenix debugger error

I’m trying to setup intellij to give it a try but I’m having trouble getting it working with Phoenix.
I have created a new Run/Debug configuration, set my program arguments to phx.server. When I run the project using the debug button it appears to run but when I visit the page I’m greeted with the error Internal server error. The console in intellij shows this:

[info] Running WebsiteWeb.Endpoint with Cowboy using http://0.0.0.0:4000
23:22:31 - info: compiled 6 files into 2 files, copied 3 in 587 ms
[info] GET /
[debug] Processing with WebsiteWeb.PageController.index/2
  Parameters: %{}
  Pipelines: [:browser]
[info] Sent 200 in 46ms
[info] Sent 500 in 66ms
[error] #PID<0.549.0> running WebsiteWeb.Endpoint terminated
Server: 0.0.0.0:4000 (http)
Request: GET /
** (exit) {%ArgumentError{message: "argument error"}, []}

Oddly enough when I run the project using the same configuration by clicking the “run” button in intellij it works perfectly fine.

Is there something I’m missing or have misconfigured? I’d like to be able to set break points and use the debugger.

Marked As Solved

KronicDeth

KronicDeth

Given no other information and since the logger doesn’t show the error, I’m going to guess it is this bug, which was actually a bug with Logger, which turned out to be a bug with :dbg_ieval, which is part of the debugger in OTP. @josevalim fixed the :dbg_ieval bug, but that means you need to wait until the next version of OTP to be released to get the fix (or erlc just that module to get the fix).

You can work around the problem for now by excluding modules from being interpreted that trigger the bug. In most cases this will be modules that have Logger calls that take an anonymous function and then interpolate inside that anonymous function like

thing = ...
Logger.info(fn -> "thing=#{thing}" end)

Last Post!

Ripster

Ripster

Excluding WebsiteWeb.Endpoint seems to have fixed it. I don’t have any explicit calls to the logger but it does use Phoenix.Endpoint and have calls to plug, both of which I believe have Logger calls with interpolated anonymous functions in them.

Thank you very much for taking time to explain the issue and help get it fixed!

Where Next?

Popular in Questions Top

stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31525 112
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement