I have problem with LiveView.ex

Hello good friends I got some problem to compile and run my localhost with problem

== Compilation error in file lib/counter_web/live/counter_live.ex ==
** (CompileError) lib/counter_web/live/counter_live.ex:2: module Phoenix.LiveView is not loaded and could not be found
(elixir) expanding macro: Kernel.use/1
lib/counter_web/live/co

I wish someone can help me :slight_smile:

Have you fetched the dependencies with mix deps.get?

Inside my live folder, I create a file counter_live.ex

defmodule CounterWeb.CounterLive do
  use Phoenix.LiveView

  def mount(_session, socket) do
    socket = assign(socket, :count, 0)
    {:ok, socket}
  end

  def render(assigns) do
    ~L"""
    <h1> Count: <%= @count %> </h1>
    <label>Counter: 0</label>
    <button> + </button>
    <button> - </button>
    """
  end
end

yes All dependencies are up to date…

So which version of liveview are you using exactly, please tell us the version as specified in mix.exs and as resolved in mix.lock.