Fresh new 1.7 Phoenix app inside umbrella fails build

Answer

The issue here was that I was using an incorrect command when creating the Phoenix app. I was using mix phx.new instead of mix phx.new.web.

To me, this is rather confusing, as from the documentation/tutorials (https://elixir-lang.org/getting-started/mix-otp/dependencies-and-umbrella-projects.html#umbrella-projects) we have this quote:

(…) First of all, since we generated this project inside kv_umbrella/apps, Mix automatically detected the umbrella structure (…)

Which states that when creating an app inside an umbrella project, Mix does have the capacity to detect it and act accordingly.

This does not hold true for Phoenix apps. For reasons beyond my understanding, Phoenix apps do not know their context and thus the user needs to tell mix that the new app will be inside an umbrella project.

This is confusing to me. Sometimes mix is smart enough to know, other times, it isn’t. I don’t know which times it knows and which times it doesn’t.

So, to conclude, given the original questions:

  1. Wrong. Mix detects umbrella projects when creating normal apps. When creating Phoenix apps, it detects nothing. The user must use mix phx.new.web. It is unclear when Mix is able to detect umbrella apps and when its not.
  2. --live flag is now default and not needed.
  3. Because I was creating the Phoenix app with an incorrect assumption and thus using the incorrect command.
1 Like