Cannot compile phoenix_live_view, dependent on downgraded phoenix_html

How do I use the latest version of phoenix_live_view with my phoenix project.

When I try to get the dependencies, error occurs.

Failed to use "phoenix_html" (version 2.14.0) because
  phoenix_ecto (version 4.1.0) requires ~> 2.9
  phoenix_live_view (version 0.6.0) requires ~> 2.13.2
  mix.lock specifies 2.14.0

** (Mix) Hex dependency resolution failed, change the version requirements of your dependencies or unlock them (by using mix deps.update or mix deps.unlock). If you are unable to resolve the conflicts you can try overriding with {:dependency, "~> 1.0", override: true}

Do I have to make it like this?
{:phoenix_live_view, "~> 0.6.0", override: true},

You need Phoenix 1.4.12. Then…

$ rm -rf deps _build mix.lock
$ mix deps.get
$ mix compile
1 Like

Here’s my dependencies:

defp deps do
      {:phoenix, "~> 1.4.12"},
      {:phoenix_pubsub, "~> 1.1"},
      {:phoenix_ecto, "~> 4.0"},
      {:ecto_sql, "~> 3.1"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.11"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.0"},
      {:plug_cowboy, "~> 2.0"},
      {:phoenix_live_view, "~> 0.6.0"},
      {:floki, ">= 0.0.0", only: :test}

Phoenix version is already 1.4.12.

It’s like mine, but I had to scratch all and rebuild. Did You do it?

Yes, I do what you’ve suggested, still the error persists.

an exception was raised:
    ** (Mix.Error) Can't continue due to errors on dependencies
        (mix) lib/mix.ex:389: Mix.raise/1
        (mix) lib/mix/tasks/deps.loadpaths.ex:28:
        (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
        (mix) lib/mix/tasks/loadpaths.ex:35:
        (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
        (mix) lib/mix/tasks/compile.ex:90:
        (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
        (language_server) lib/language_server/build.ex:164: ElixirLS.LanguageServer.Build.compile/0

Are You in VSCode? I had to leave VSCode before doing this…

Yes I use VSCode. I will try exiting the text editor.

I had this problem too with VSCode fetching dependencies, while I was doing the same in the console.

If you get this in vscode, rm -rf .elixir_ls and reload the editor.

1 Like

Closing the editor and reinstalling the dependencies works.