Trouble with default core components and compatibility with `phx.gen.html` (missing slots)

Hi! Elixir newbie here.

I’m rewriting my website in Phoenix, and I’ve really enjoyed it so far. I’m currently stuck in an interesting situation.

My app is essentially a vanilla mix phx.new application. I ran mix phx.gen.html to generate a controller, and I’m getting errors about missing slots. Specifically:

key :subtitle not found in: %{
  __changed__: nil,
  inner_block: [
    %{
      __slot__: :inner_block,
      inner_block: #Function<32.41202399/2 in AppWeb.CustomerHTML.index/1>
    }
  ],
  actions: [
    %{
      __slot__: :actions,
      inner_block: #Function<33.41202399/2 in AppWeb.CustomerHTML.index/1>
    }
  ]
}

So, I tracked this down to core_components.ex:

  @doc """
  Renders a header with title.
  """
  attr :class, :string, default: nil

  slot :inner_block, required: true
  slot :subtitle
  slot :actions

  def header(assigns) do
    ~H"""
    <header class={[@actions != [] && "flex items-center justify-between gap-6", @class]}>
      <div>
        <h1 class="text-lg font-semibold leading-8 text-zinc-800">
          <%= render_slot(@inner_block) %>
        </h1>
        <p :if={@subtitle != []} class="mt-2 text-sm leading-6 text-zinc-600">
          <%= render_slot(@subtitle) %>
        </p>
      </div>
      <div class="flex-none"><%= render_slot(@actions) %></div>
    </header>
    """
  end

I read that slots default to [], but it seems that the comparison is failing before the comparison can even be made in :if={@subtitle != []} – it looks like the basic access of @subtitle.

I’ve tried to dig in a bit, but to be honest, I feel like I’m missing something obvious. I’d think that the codegen from phx.gen.html would play nicely with these default core components. Maybe I missed a step in codegen? If not, is this expected, and should I just special case all of the slots/remove them?

Thanks for your time.