{"record":{"id":"9c8617b21c584344","repo":"gatsbyjs/gatsby","slug":"warning-found-one-or-more-service-workers-present","errorCode":null,"errorMessage":"Warning: found one or more service workers present. If your site isn't behaving as expected, you might want to remove these.","messagePattern":"Warning: found one or more service workers present\\. If your site isn't behaving as expected, you might want to remove these\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/cache-dir/app.js","lineNumber":125,"sourceCode":"  const socket = socketIo()\n  if (socket) {\n    socket.on(`reload`, () => {\n      window.location.reload()\n    })\n  }\n\n  /**\n   * Service Workers are persistent by nature. They stick around,\n   * serving a cached version of the site if they aren't removed.\n   * This is especially frustrating when you need to test the\n   * production build on your local machine.\n   *\n   * Let's warn if we find service workers in development.\n   */\n  if (`serviceWorker` in navigator) {\n    navigator.serviceWorker.getRegistrations().then(registrations => {\n      if (registrations.length > 0)\n        console.warn(\n          `Warning: found one or more service workers present.`,\n          `If your site isn't behaving as expected, you might want to remove these.`,\n          registrations\n        )\n    })\n  }\n\n  const rootElement = document.getElementById(`___gatsby`)\n  const renderer = apiRunner(\n    `replaceHydrateFunction`,\n    undefined,\n    reactFirstRenderOrHydrate\n  )[0]\n\n  let dismissLoadingIndicator\n  if (\n    process.env.GATSBY_QUERY_ON_DEMAND &&\n    process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR === `true`","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/cache-dir/app.js#L107-L143","documentation":"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.","triggerScenarios":"Thrown at packages/gatsby/cache-dir/app.js:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Unregister them: DevTools → Application → Service Workers → Unregister (or run navigator.serviceWorker.getRegistrations().then(rs => rs.forEach(r => r.unregister())) in the console)","Tick 'Bypass for network' in DevTools while developing","Avoid registering service workers from production code when building/testing locally"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}