# Error bags no longer block \`onSuccess\` callback in Inertia

Canonical URL : https://adonisjs-signal.jrmc.dev/insights/35c644ba-bfd6-47b7-a38b-533813284156
Source release or documentation date : 2026-10-22T18:32:21.000Z
Category : release | Developer impact : medium
Affected packages : @adonisjs/inertia

In Inertia v5\.0\.5, when using error bags \(e\.g\., \`errorBag: 'createUser'\`\), the client previously treated any error bag key as a failed submission, causing \`onSuccess\` not to be called even if validation passed\. Now, \`getValidationErrors\(\)\` returns an empty object \`\{\}\` when there are no errors, allowing \`onSuccess\` to be triggered correctly\.

## What this means for your code

Developers who used error bags in Inertia forms might have experienced \`onSuccess\` callbacks not firing due to empty error bags being interpreted as errors\. This update fixes that behavior, so dialogs or UI elements relying on \`onSuccess\` will now behave as expected without workarounds\.

## Suggested actions

- Remove any middleware workarounds that filtered out empty error bags in Inertia submissions, as they are no longer necessary\.

## Original sources

- [error bags no longer block \`onSuccess\`](https://github.com/adonisjs/inertia/releases/tag/v5.0.5)

AI-generated analysis based on the linked sources. Check the original documentation before changing your application.
