2025-10 or later, reject the promise passed to event.waitUntil() with an AggregateError containing individual Error objects. As of November 19, 2026, Shopify displays multiple messages on discount and checkout-rule pages instead of forcing merchants to fix one field at a time.On this page
Why the merchant used to see one error per save
Previously, a rejected onSubmit promise produced one visible error message. A form with an invalid minimum quantity and an invalid percentage could appear to accept everything except the first bad field. Developers often worked around this with custom banners or sequential saves. Shopify’s November 19 change recognizes the errors entries of AggregateError on supported Function settings surfaces.
Use a structured error for each invalid setting
function fieldError(code, message) {
return Object.assign(new Error(message), { code });
}
async function save(settings) {
const errors = [];
if (!settings.minimumQuantity) {
errors.push(fieldError(
'MINIMUM_QUANTITY_REQUIRED',
'Enter a minimum quantity.'
));
}
if (Number(settings.percentage) > 100) {
errors.push(fieldError(
'PERCENTAGE_TOO_HIGH',
'Percentage cannot exceed 100.'
));
}
if (errors.length) {
throw new AggregateError(errors, 'Invalid settings');
}
// Persist the validated settings here.
}
// In your s-function-settings component:
// onSubmit={(event) => event.waitUntil(save(settings))}
The snippet is the validation core, not a complete extension. Use your existing settings persistence logic only after validation succeeds. In the onError handler, inspect event.error.errors and map each entry’s code to the corresponding field’s error state. Do not rely only on the aggregate’s summary message.
Limits and compatibility that matter
- Shopify displays at most ten errors; each message is trimmed to 300 characters.
- Duplicate messages appear once. Use distinct, actionable messages rather than the same “Invalid value” everywhere.
- Error codes must be nonempty and no longer than 64 characters. Invalid or missing codes become
UNKNOWNon discount pages andEXTENSION_ERRORon checkout-rule pages. - A single
Errorstill works and displays one message. Earlier extension API versions retain the old single-error behavior. - The
onerrortyping is available in@shopify/ui-extensionsversions2025-10,2026-10, and the2027-01release candidate.
Design the validation for production
Validate cross-field rules too: a minimum threshold might conflict with a maximum, and a checkout rule might require a location or market selection. Keep error codes stable for testing and field mapping, but write merchant-facing messages in plain language. Do not submit partial settings after validation fails.
onError and the codes to mark fields in its own UI.- Open a supported Function settings extension in a development store and enter two independent invalid values.
- Save once; confirm both messages appear in the Shopify admin and no settings write occurs.
- Verify the extension’s onError handler receives both codes and highlights the intended fields.
- Test repeated messages, an empty code, and more than ten errors to confirm the documented limits.
- Correct only one field and save again; confirm the remaining error is shown without stale field errors.
- Save valid settings and verify the resulting discount or checkout rule behavior, not just a successful UI submission.

