Skip to content

error bags no longer block `onSuccess`

Latest

Choose a tag to compare

@github-actions github-actions released this 22 Oct 18:32
Immutable release. Only release title and notes can be modified.

5.0.5 (2026-10-22)

Bug Fixes

  • middleware: let successful submissions with an error bag call onSuccess (#118) (47ee662)

When a form uses an error bag (errorBag: 'createUser'), the Inertia client sends the X-Inertia-Error-Bag header. Until now, getValidationErrors() returned { createUser: {} } even when validation passed. The client treats any key in errors as a failed submission, so it called onError({}) and never onSuccess. For example, a dialog that closes in onSuccess stayed open.

getValidationErrors() now returns {} when there are no errors, with or without an error bag. If you added a workaround that filters out empty error bags in your Inertia middleware, you can remove it.