v29.6
Release Notes — v29.6
PWA Offline Fix (Service Worker Routing Hardening)
Summary
This release restores true offline-first PWA behavior by preventing service worker scripts from being swallowed by the SPA catch-all route. sw.js (and service-worker.js, if you ship both) are now served as real JavaScript files end-to-end, allowing the browser to install, register, cache, and claim clients reliably.
What changed
✅ Service worker scripts are served directly (no SPA rewrite)
-
Ensured requests to:
/sw.js/service-worker.js(if present)
-
are handled as static JS assets and never rewritten to your app’s
index.htmlvia SPA fallback rules.
✅ Correct MIME + payload delivered
- These endpoints now return JavaScript, not HTML.
- This fixes the classic failure mode where the browser tries to execute
index.htmlas the worker script, causing install/register to silently fail or loop.
Why it matters
Offline-first is back
With service worker routing fixed, the PWA regains its core guarantees:
- Reliable service worker registration
- Asset + route caching behaves deterministically
- Clients are claimed properly (navigation + control works immediately)
- Offline navigation works (cached shell/pages render without network)
- Background sync / update flows resume (where supported)
In short: the PWA works like a PWA again — installable, resilient, and offline-capable.
How to verify
1) Confirm service worker script responses are JS
After redeploy:
-
Open DevTools → Network
-
Visit:
/sw.js/service-worker.js(if applicable)
-
Confirm:
- Status:
200 - Content-Type:
application/javascript(or equivalent JS type) - Response body: actual worker JS (not HTML)
- Status:
If you see
<!doctype html>anywhere in the response, the SPA fallback is still intercepting it.
2) Validate install + claim in a clean session
-
Open a fresh Incognito window
-
Load the site once
-
DevTools → Application → Service Workers
-
Confirm:
- Service worker is installed
- Service worker is activated
- Clients are claimed (page shows “controlled by service worker”)
3) Confirm offline navigation works
-
With the app loaded and the worker installed, toggle:
- DevTools → Network → ✅ Offline
-
Navigate between routes (or hard reload if your caching strategy supports it)
-
Confirm:
- App shell loads
- Cached pages/assets render without network
- No “online-only” blank screens
Notes
- This fix is intentionally boring and absolute: service worker scripts must never be routed through SPA HTML fallbacks.
- If you ship both
sw.jsandservice-worker.js, keep them both protected from rewrites to avoid environment-specific failures.
✅ v29.6 restores offline-first behavior by making the worker script endpoints untouchable by SPA rewrites.
What's Changed
- v29.5.8 by @Phinetwork in #51
- v29.5.9 by @Phinetwork in #52
- 29.6 by @Phinetwork in #53
Full Changelog: v29.5.5...v29.6