Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

GDS Error Banner Not Showing? Fix the Error Summary

· 5 min read · Home Tech

In this article
  1. Make the Error Summary Banner Appear in Six Steps
  2. Symptom, Likely Cause and Fix at a Glance
  3. Fixing the Most Common Cause: the Error List Never Reaches the Template
  4. Keeping the Banner Correct as the Form Grows
  5. When the Banner Is Showing but Users Still Miss It

The GDS error banner (the GOV.UK error summary that says "There is a problem") appears only when your template renders the error summary component and the page has at least one error in its error object. Most cases are fixed by adding the macro, passing errors in, and moving focus to it on validation failure.

Time 15 min · Steps 6 · Level Medium

Make the Error Summary Banner Appear in Six Steps

  1. Render the component. Add the govukErrorSummary macro (Nunjucks) or the error summary component (React/other ports) near the top of the page, before the main form content, so it is the first thing a screen reader or keyboard user reaches.
  2. Pass the errors in. Give the macro an errorList array where each item has href (the id of the field with the error, including the #) and text (the error message). An empty or malformed array renders nothing.
  3. Set the title text. The default heading is "There is a problem". Keep it unless your service has a reason to change it; the heading level should match the surrounding page structure.
  4. Move focus to the banner. On the server-side or client-side validation failure, set focus to the error summary container (it has tabindex="-1" by default) so keyboard and screen reader users land on it immediately.
  5. Link each item to its field. Each href must point to an element id that exists on the page, normally the erroring input or its error message container, so the link jumps the user to the problem.
  6. Add per-field error messages. Each invalid input also needs the red error message and the govuk-form-group--error class, plus aria-describedby pointing at the message id, so the banner and the field agree.

Symptom, Likely Cause and Fix at a Glance

Most "missing banner" reports come down to one of six things. Match what you see to the row and apply the fix.

Fixing the Most Common Cause: the Error List Never Reaches the Template

The single most common cause is the errors existing in your validation layer but never reaching the template. Confirm it by rendering the error object temporarily (for example, printing it in the template or reading it in your browser's developer tools network response) — if it is empty or shaped differently from what the macro expects, the banner cannot appear.

Shape each entry like this in Nunjucks:

Then, on each field, pass the same message so the two never disagree:

Keep the wording identical between the banner entry and the field message. The banner link text and the field error message matching is what lets a screen reader user confirm they landed on the right problem after clicking the link.

Confirming the Fix Worked

Submit the form empty and check three things: the banner appears at the top of the page, keyboard focus lands on it without you pressing Tab, and clicking a banner link moves focus to the named field. Then submit with only one field invalid to confirm the banner lists exactly the real errors, not a stale list. If your service supports Welsh or other languages, repeat once in that language.

Keeping the Banner Correct as the Form Grows

Build the errorList from the same source of truth the field messages use — one validation result object, mapped once — rather than writing the banner list by hand. This stops the banner and the fields drifting apart when a new field is added.

Order the entries to match the visual order of the fields on the page, so the first link is the first problem the user sees. Use the field's question text in the message ("Enter your full name", not "Invalid input") so the banner makes sense read on its own, which is how screen reader users hear it.

Test with JavaScript turned off as well as on: the server-rendered banner must appear and work without any client script, because the component is designed to be fully functional server-side. Menu names, macro parameters and class names can differ slightly between versions of the design system and its ports, so check the component page in the GOV.UK Design System for the exact options your version supports.

When the Banner Is Showing but Users Still Miss It

If the banner renders and focuses correctly but users still skip it, check placement and re-render behaviour. The banner must be the first focusable element after a failed submit — if a cookie banner or skip link grabs focus first, move the error summary focus call later in the load order. Also confirm the page title changes on error (for example, prefixing it with "Error:"), because screen reader users hear the title first and it signals that the submit failed even before the banner is read.

Official source: GOV.UK Design System

SymptomLikely causeFix
No banner at all, fields show red errorsError summary macro not rendered, or errorList emptyAdd the macro above the form and build the array from your validation errors
Banner appears but links do nothinghref missing the field id or pointing at an id that does not existSet href to the exact id of the erroring input, including the leading #
Banner appears below the form or in a odd spotMacro placed inside the form or main content blockMove it to the top of the page, after the back link and before the h1 or form
Focus stays on the first fieldNothing moves focus after validation failsSet focus to the error summary on render when errors exist
Banner shows but fields are not marked invalidPer-field error message and classes missingAdd the error message, the group error class and aria-describedby
Banner flashes then disappearsClient-side script re-rendering the page without errorsKeep the error state in the re-render, or re-trigger the summary after failed client validation