Liveview 0.18.3 warning: passing a string as a layout template in use options is deprecated,

how to supress this warning ?

warning: passing a string as a layout template in use options is deprecated, please pass an atom, such as :live instead of “live.html”
(phoenix_live_view 0.18.3) lib/phoenix_live_view/utils.ex:154: Phoenix.LiveView.Utils.normalize_layout/2
(phoenix_live_view 0.18.3) lib/phoenix_live_view.ex:493: Phoenix.LiveView.“MACRO-before_compile”/2
(elixir 1.14.0) src/elixir_dispatch.erl:224: :elixir_dispatch.expand_macro_fun/7
(elixir 1.14.0) src/elixir_dispatch.erl:211: :elixir_dispatch.expand_require/6
(elixir 1.14.0) src/elixir_dispatch.erl:135: :elixir_dispatch.dispatch_require/7
(elixir 1.14.0) src/elixir_module.erl:398: :elixir_module.expand_callback/6

it is in app_web

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

  unquote(view_helpers())                                                         
end                                                                               

end

I’m not sure you can suppress this warning specifically but being that a deprecated usage you might want to change that before the next releases.

1 Like

layout: {AppWeb.LayoutView, “live.html”}

must be replaced by

layout: {AppWeb.LayoutView, :live}

to remove the warning

6 Likes