gatsbyjs/gatsby · error

Warning: found one or more service workers present. If your

Error message

Warning: found one or more service workers present. If your site isn't behaving as expected, you might want to remove these.

What it means

Development-runtime diagnostic in Gatsby's browser app bootstrap: navigator.serviceWorker.getRegistrations() found one or more registered service workers. Leftover (e.g. production) service workers keep serving stale cached content over the dev server, so the app warns that behavior may differ from the freshly built code.

Source

Thrown at packages/gatsby/cache-dir/app.js:125

  const socket = socketIo()
  if (socket) {
    socket.on(`reload`, () => {
      window.location.reload()
    })
  }

  /**
   * Service Workers are persistent by nature. They stick around,
   * serving a cached version of the site if they aren't removed.
   * This is especially frustrating when you need to test the
   * production build on your local machine.
   *
   * Let's warn if we find service workers in development.
   */
  if (`serviceWorker` in navigator) {
    navigator.serviceWorker.getRegistrations().then(registrations => {
      if (registrations.length > 0)
        console.warn(
          `Warning: found one or more service workers present.`,
          `If your site isn't behaving as expected, you might want to remove these.`,
          registrations
        )
    })
  }

  const rootElement = document.getElementById(`___gatsby`)
  const renderer = apiRunner(
    `replaceHydrateFunction`,
    undefined,
    reactFirstRenderOrHydrate
  )[0]

  let dismissLoadingIndicator
  if (
    process.env.GATSBY_QUERY_ON_DEMAND &&
    process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR === `true`

View on GitHub (pinned to e85d62f177)

Solutions

  1. Unregister them: DevTools → Application → Service Workers → Unregister (or run navigator.serviceWorker.getRegistrations().then(rs => rs.forEach(r => r.unregister())) in the console)
  2. Tick 'Bypass for network' in DevTools while developing
  3. Avoid registering service workers from production code when building/testing locally
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/gatsby/cache-dir/app.js:125 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/9c8617b21c584344. Report an issue: GitHub.