After updating phoenix_live_view
from version 0.19.3
to version 0.19.5
, I get the following error when I run Dialyzer:
lib/my_app_web/live/books/create_or_edit.html.heex:1:no_return
The created anonymous function has no local return.
Here is the content of the file:
<.simple_form
:let={f}
id={"edit-book-#{@book.id}"}
for={@changeset}
phx-change="validate"
phx-submit="submit"
as="form"
>
<.input field={{f, :title}} label={gettext("Title")} />
<.input
field={{f, :language}}
type="select"
options={language_options()}
label={gettext("Language")}
/>
<fieldset class="flex flex-col gap-2">
<legend><%= gettext("EBook formats") %></legend>
<%= for ebook_form <- Phoenix.HTML.Form.inputs_for(f, :ebook_formats) do %>
<.ebook_line form={ebook_form} />
<% end %>
<.button class="mt-2" type="button" phx-click="add-ebook">
<Heroicons.document_plus class="w-6 h-6" />
</.button>
</fieldset>
<:actions>
<.button><%= gettext("Save") %></.button>
<.button phx-click="cancel"><%= gettext("Cancel") %></.button>
</:actions>
</.simple_form>
<%= if @live_action == :edit do %>
<div>
<.live_component
module={MyAppWeb.SearchTagComponent}
id="search_tag"
selected_tags={@selected_tags}
/>
</div>
<% end %>
I tried to remove the if
section at the bottom, but the error still occurs.
Any idea what might be the problem?
Other information that might be relevant:
- Elixir 1.15.4 / Erlang 26.0.2
dialyxir
1.3.0- Updating
phoenix_live_view
also updated the following packages:json
,phoenix
,phoenix_html
, andphoenix_template
(all patch-level updates).