0

I installed Phoenix 1.7-rc along with Elixir 1.14.1 and Erlang/OTP 24. I then created a new project using mix phx.new command. The compilation fails with the following error:

Unchecked dependencies for environment dev:
* phoenix (Hex package)
  the dependency phoenix 1.7.0-rc.0

  > In apps/trial_web/mix.exs:
    {:phoenix, "~> 1.7.0-rc.0", [env: :prod, repo: "hexpm", hex: "phoenix", override: true]}

  does not match the requirement specified

  > In deps/phoenix_live_view/mix.exs:
    {:phoenix, "~> 1.6.15 or ~> 1.7.0", [env: :prod, hex: "phoenix", repo: "hexpm", optional: false]}

  Ensure they match or specify one of the above in your deps and set "override: true"
** (Mix) Can't continue due to errors on dependencies

This is how the dependency is defined in mix.exs

{:phoenix, "~> 1.7.0-rc.0", override: true},

Since the override: is set to true, my understanding is that it should override any other definitions of itself by other dependencies.

What am I missing?

Edit: As @delameko pointed out, I am working with an umbrella project, and once I remove phoenix_live_view dependency from the root mix.exs, I can compile. However, it is not ideal, as I lose the ability to run mix format on heex files from the root project.

Edit 2: Since phoenix_live_view is required to run "mix format" on ~H/.heex files from the umbrella root and it depends on the phoenix, after I add phoenix on the root mix.exs, the project compiles.

101V
  • 492
  • 1
  • 6
  • 13
  • AFAIK, the `override: true` only affects that specific dependency, but the conflict you hit is with `phoenix_live_view`. Is there a newer version of `phoenix_live_view` that is compatible with `phoenix` version `1.7.0-rc.0`? You may need to specify that newer version of `phoenix_live_view` in your `mix.exs` – Everett Nov 09 '22 at 12:52
  • There seems to be a bug when building the project as an umbrella. You can get the project to compile by commenting out the phoenix_live_view dependency in the root mix.exs of the umbrella (note, you won't be able to run `mix format` on heex files from the root of the project). – Delameko Nov 09 '22 at 13:11
  • @Everett thank you for your comment, I am afraid there is no newer version of `phoenix_live_view`. – 101V Nov 10 '22 at 03:26
  • @Delameko you are right. Once I commented out `phoenix_live_view` in the root `mix.exs` of the umbrella project. It compiles. I am adding this fact in my question. – 101V Nov 10 '22 at 03:38

0 Answers0