Developer debugs service worker redundant bug in Next.js PWA with Claude's help

A developer shared their experience building Somnia, a dream incubation and programming app, almost entirely with Claude as a coding partner. The app is a Next.js 14 Progressive Web App that installs to home screens like a native app, sends push notifications at sleep/wake times, stores all data locally on device, and avoids app store distribution.
The problematic bug
The developer spent three weeks debugging a critical issue where web push notifications weren't working. The service worker kept going REDUNDANT immediately after installing in PWA standalone mode on Samsung Android devices. navigator.serviceWorker.getRegistrations() consistently returned empty arrays in this mode.
Debugging process
During the debugging process, the developer:
- Consulted Claude, GPT, Gemini, and Perplexity for assistance
- Generated full debug reports
- Tried over 15 different fixes
- Built a debug page that finally showed the service worker going REDUNDANT
- Interpreted
chrome://serviceworker-internalsoutput with Claude's help
The root cause
The actual problem was that sw.js had been accidentally committed to git with a stale build ID. The precache manifest inside was trying to fetch assets from an old deployment, which all returned 404 errors. Workbox's install event failed silently, causing the service worker to self-destruct every time.
The fix
The solution was simple: git rm --cached command fixed the issue by removing the stale file from the cache.
Claude helped maintain systematic debugging when the developer wanted to give up, and while the app contains zero AI-generated content (all dream entries are written by humans), it was built almost entirely through conversation with Claude.
📖 Read the full source: r/ClaudeAI
👀 See Also

Exploring Success Stories for the Android Companion App via Tailscale
Discover how Android companion apps leverage Tailscale to enhance security and connectivity, based on discussions from the OpenClaw community.

OpenClaw Testing Agent for Mobile Apps: Setup and Results
A developer built a mobile testing agent on OpenClaw that runs plain English test steps on cloud emulators, catching bugs that manual testing misses. The service costs $350-600/month per client and has converted 70-75% of trial leads.

Building a 200k LOC Production App via Vibe Coding from a Phone
A developer built Vibe Remote, a mobile vibe-coding tool with ~200,000 lines of code (140k Go, 60k Swift), primarily by messaging Claude Code through the app from their phone. The project revealed key challenges like DRY violations and E2E test bottlenecks.

Picar robot car demonstrates autonomous video production with OpenClaw
A PiCar-X robot running OpenClaw with Claude Sonnet on Raspberry Pi 5 autonomously creates YouTube videos by writing scripts from memory logs, generating images with DALL-E 3, narrating with cloned ElevenLabs voice, and assembling with ffmpeg.