mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 22:21:10 +02:00
The PWA was configured end-to-end in vite.config.ts and built the manifest + service worker correctly, but neither was ever loaded by the browser — no <link rel="manifest"> in the HTML and no script registering the generated registerSW.js. Chrome therefore never fired beforeinstallprompt, no install icon appeared in the URL bar, and the hand-rolled PwaUpdatePrompt hung on navigator.serviceWorker.ready because no SW had been registered. Changes: - Render pwaInfo.webManifest.linkTag into <svelte:head> in the root layout so Chrome finds the hashed manifest. - Replace the hand-rolled SW-update logic in PwaUpdatePrompt with useRegisterSW() from virtual:pwa-register/svelte — it registers the worker (immediate: true) and exposes reactive needRefresh + updateServiceWorker stores that match registerType: 'prompt'. - Add triple-slash refs to vite-plugin-pwa/info and /svelte in app.d.ts for the virtual module types. - Set manifest.id = startUrl in @mana/shared-pwa so Chrome doesn't warn and keeps the install identity stable across start_url edits. - Keep devEnabled: false and expand the comment: the 2026-04-08 dreams mic-button bug and the /offline navigateFallback both misbehave when Workbox precache doesn't run under vite dev. Test the install flow via `pnpm build && pnpm preview` instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| package.json | ||
| tsconfig.json | ||