Skip to content

Shopify Dude Fix

Shopify Function Settings Only Show One Validation Error? Use AggregateError

As of November 19, 2026, Shopify Function settings extensions can show up to ten validation errors at once. Use AggregateError in onSubmit and test field-level feedback.

Quick answer: For Function settings extensions built with Polaris web components on API 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 UNKNOWN on discount pages and EXTENSION_ERROR on checkout-rule pages.
  • A single Error still works and displays one message. Earlier extension API versions retain the old single-error behavior.
  • The onerror typing is available in @shopify/ui-extensions versions 2025-10, 2026-10, and the 2027-01 release 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.

Common misunderstanding: “Throwing AggregateError automatically highlights every invalid field.” Shopify displays the messages; your extension still needs to use onError and the codes to mark fields in its own UI.
How to test this

  1. Open a supported Function settings extension in a development store and enter two independent invalid values.
  2. Save once; confirm both messages appear in the Shopify admin and no settings write occurs.
  3. Verify the extension’s onError handler receives both codes and highlights the intended fields.
  4. Test repeated messages, an empty code, and more than ten errors to confirm the documented limits.
  5. Correct only one field and save again; confirm the remaining error is shown without stale field errors.
  6. Save valid settings and verify the resulting discount or checkout rule behavior, not just a successful UI submission.