UndefinedFunctionError at GET /app function TestWeb.AppLive.__live__/0 is undefined (module TestWeb.AppLive is not available)

Hello I’m trying to create my first LiveView in Phoenix

I have:

router.ex

scope "/", TestWeb do
  pipe_through :browser
  live "/app", AppLive
end

app_live.ex

defmodule TestWeb.AppLive do
  use TestWeb, :live_view
  
  def render(assigns) do
    ~H"""
    test
    """
  end

  def mount(_params, _session, socket) do
    {:ok, socket}
  end
end

but I get this error

UndefinedFunctionError at GET /app

function TestWeb.AppLive.__live__/0 is undefined (module TestWeb.AppLive is not available)

I would first check to see if your code compiles without errors/warnings.
If so, try to do a mix do clean, compile and try again.