s-stepien
Application module `start` function not called?
Hi
I have fairly complicated Phoenix app (but it doubt that this is Phoenix related issue?). In it I have the MyApp.Application module with start(_type, _args) function. I noticed today (after long time without working on it), that the start() function isn’t called at all. In the mix.exs file, the mod: is set correctly to that module - I haven’t changed anything there.
How one can try to debug this? What is happening before call to start() - maybe something there hangs?
I’ve tried rebuild from scratch, re-get deps, etc. And nothing, the function will not be called.
When I created new project, all seems OK in it.
I’m using Erlang/OTP 28.1 and Elixir 1.18.4
Update:
If I use MIX_ENV=prod, then I can see print at the beginning of the start() function. But I want to use the dev env ![]()
Most Liked
jswanner
I believe @garrison is trying to get at is if any of the children in your application are running, if so then your application is running, and your endpoint is an easy one to test if it’s running.
How are you running your application? mix phx.server from the terminal, or some other way? Is it possible something is swallowing that IO you are using to debug? Instead of IO.inspect("here") you can try raise "here"
s-stepien
@garrison none of the children are started. The function is not called/entered.
@jswanner even with raise “here” it will not stop it. I’m using iex -S mix phx.server with some env variables.
Note that with MIX_ENV=prod it works, every time. With MIX_ENV=dev it does not. Only this MIX_ENV is different in invocation.
jswanner
diff _build/{dev,prod}/lib/<app_name>/ebin/<app_name>.app







