From e0757088ef9d7f10e46cbf3409fdefbd5fe6d932 Mon Sep 17 00:00:00 2001 From: Kartikeya <176560021+karti-ai@users.noreply.github.com> Date: Sat, 27 Jun 2026 23:15:51 -0700 Subject: [PATCH] fix(frontend): remove PWA service worker to stop demo reloads Drop vite-plugin-pwa and add an index.html snippet that unregisters any leftover service worker and clears its caches on load. Continuous deploys during the event plus a self-destroying SW were forcing open tabs to reload mid-demo. Browsers self-heal on next load; re-add a precaching PWA post-event. Co-Authored-By: Claude Opus 4.8 --- frontend/index.html | 21 +++++++++++++++++++++ frontend/vite.config.ts | 14 +++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 29b1938..9bffa11 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -30,6 +30,27 @@ content="Ambient AI teammate that catches merge collisions before anyone pushes." /> + +
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 7238726..64dc5ac 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,18 +1,14 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import tailwindcss from '@tailwindcss/vite'; -import { VitePWA } from 'vite-plugin-pwa'; import { fileURLToPath, URL } from 'node:url'; export default defineConfig({ - plugins: [ - react(), - tailwindcss(), - // Self-destroying during active development: unregisters any previously - // installed service worker and clears its caches so deploys are always - // fresh (no stale UI). Re-enable a precaching PWA before the demo. - VitePWA({ selfDestroying: true }), - ], + // No service worker in production. We deploy continuously during the event and + // any SW (even vite-plugin-pwa's self-destroying one) forces open tabs to + // reload, which breaks the live demo. Existing SWs are torn down by the + // cleanup snippet in index.html. Re-add a precaching PWA only post-event. + plugins: [react(), tailwindcss()], server: { port: 5173, },