Converting to LiveView, using root.html.leex, but liveview is not rendered inside live.html.leex

I’ve converting a standard page into a LiveView. I’ve got everything working, except it isn’t using the live.html.leex layout. It renders the root.html.leex → app.html.eex for normal pages, but it only renders root.html.leex for the liveview page. I can’t figure out why that layout is being skipped.

Any help is appreciated.

Hello and welcome,

You probably need to update your app_web.ex and add…

  def live_view do
    quote do
      use Phoenix.LiveView,
        layout: {AppWeb.LayoutView, "live.html"}

      unquote(view_helpers())
    end
  end

  def live_component do
    quote do
      use Phoenix.LiveComponent

      unquote(view_helpers())
    end
  end

As You are migrating, try to create a fresh phoenix project with --live flag, and check the web file.

Unfortunately, that isn’t it. I already have those functions.

Thanks for the suggestions though.

Not sure how, but it is working now.