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 AI Tools on Low-End Laptop Without GPU
A user successfully ran OpenClaw AI tools on a basic laptop without a dedicated GPU, sharing their setup process in a YouTube tutorial.

Developer builds 6 iOS apps in 3 months using Claude Code, generates revenue
A developer used Claude Code to build and publish 6 iOS utility apps in 3 months, focusing on solving small real problems rather than perfection. The apps are now generating daily usage and revenue.

Claude AI coding assistant requires precise task breakdowns to avoid wasted time
A developer spent 4.5 hours with Claude Code trying to fix a page, only to solve it in 10 minutes by rewriting from scratch with a different library. The issue stemmed from unclear instructions that didn't specify exploring alternative tools.

Claude Sonnet 4.6 Grades Bug Reports from Four Qwen3.5 Local Models
A developer tested four Qwen3.5 variants by having them generate bug reports for an iOS game issue, then had Claude Sonnet 4.6 grade the reports. The models correctly identified a Swift bug where equipment border colors don't reset, but test code had compilation issues.