From e6d925cad0d4406473894f284f7bb1b73900c6ab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 03:26:09 +0000 Subject: [PATCH] feat: proactively unregister service workers in dev mode Co-authored-by: hyoban <38493346+hyoban@users.noreply.github.com> --- web/app/components/provider/serwist.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/app/components/provider/serwist.tsx b/web/app/components/provider/serwist.tsx index 696012e3ee..4f43c751c1 100644 --- a/web/app/components/provider/serwist.tsx +++ b/web/app/components/provider/serwist.tsx @@ -1,9 +1,20 @@ 'use client' import { SerwistProvider } from '@serwist/turbopack/react' +import { useEffect } from 'react' import { IS_DEV } from '@/config' export function PWAProvider({ children }: { children: React.ReactNode }) { + useEffect(() => { + if (IS_DEV && 'serviceWorker' in navigator) { + navigator.serviceWorker.getRegistrations().then((registrations) => { + registrations.forEach((registration) => { + registration.unregister() + }) + }) + } + }, []) + if (IS_DEV) { return <>{children} }