dlebrun
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
dialyxir1.3.0- Updating
phoenix_live_viewalso updated the following packages:json,phoenix,phoenix_html, andphoenix_template(all patch-level updates).
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
sodapopcan
Hello and welcome to the forums
I’m far from a dialyzer but expert but since you’re getting no bites I thought I’d respond and can hopefully help you diagnose.
Errors in anonymous functions can be a bit of pain sometimes since the reported failing line number is that of the callsite of the function that calls the anonymous function. In this case, that function is
simple_form/1which happens to be on line1. That’s why removing theifdid nothing since it’s not called withinsimple_form/1.I guess that’s probably not much more information than you’ve probably already tried now but hopefully somewhat helpful. I’m assuming the error is in the list comprehension (
for) since that is the only place I can that there is for sure an anonymous function call.codeanpeace
According to the changelog for
Phoenix.HTML, bothinputs_for/2andinputs_for/3were recently deprecated thoughinputs_for/4remains.inputs_for/4also happens to expect an anonymous function which probably explains the dialyzer error you’re seeing.While you could try getting
Phoenix.HTML.Form.inputs_for/4to work, it seems like a good opportunity to swap it out for the newerPhoenix.Component.inputs_for/1instead.dbaer
I ran into this too. After fiddling with clearing _build and various recompilations I managed to get Elixir to eek out the deprecation notice for inputs_for exactly once, and that pointed me in the right direction.
As an aside, It would be nice if compiler warnings were more consistent. Sometimes they show after an _build delete and recompile, sometimes they show up in production compile, sometimes in CI.