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

Running OpenClaw for multiple users requires isolation and security layers
A developer built a thin infrastructure layer around OpenClaw to handle multiple users safely, addressing isolation, secrets management, and persistent state. The solution includes per-user workers, virtual filesystems, and a gateway for messaging platforms.

Building a 7-Agent AI Trading Desk with OpenClaw
Discover the setup of a 7-agent AI trading desk using OpenClaw, running on a Mac mini with Claude as the brain, featuring custom Flask dashboards and Cron jobs.

Building a Video Generation Pipeline with OpenClaw, ClawVid, and Composio
A developer built a weekend project using OpenClaw as the runtime with Claude as the LLM, integrating Composio for tool authentication and ClawVid with Remotion for video generation. The pipeline creates MP4 videos with voiceover, visuals, music, and subtitles from text prompts.

Claude Project for Daily Planning with Todoist and Google Calendar Integration
A developer built a Claude Project that functions as a full-time management assistant connected to Todoist and Google Calendar. The system plans daily schedules, tracks habits, and runs reviews using three specific roles: Task Auditor, Habit Scheduler, and Schedule Composer.