Error_tag not showing

This is probably way too late, but in case someone else stumbles across this thread as well.

Possible causes of error tag not showing:

  1. Check your changeset - does it actually contain errors?
  2. Check DOM in browser and see if the field actually renders, but is hidden by invalid-feedback class… you might want to comment it out while debugging to make it easier. (The class will typically be defined in .css file in /assets/css/app.css )
  3. Check which action is set on your changeset. If it is set to :nil or :ignore, error will not be shown. (See a note on errors in Phoenix.HTML.Form). If this is the case you can either use # {_reply, changeset} = Changeset.apply_action(changeset, :insert) or change the action field manually e.g. {:noreply, assign(socket, changeset: %{changeset | action: :insert})}.
    `

Also, I’ve found a related post on the topic.

5 Likes