---
created: 2026-03-13
tags: [incident, rateright-app, resolved]
related: ["[[04-Operations/SOPs/Deployment SOP]]"]
---

# 2026-03-13: Stale Build Manifest — Landing Page UI Degraded

## Summary
RateRight landing page CSS/JS failing to load intermittently. Pages returned unstyled or threw 500s for some asset requests. Browsers received mismatched chunk hashes — some worked, some didn't.

## Root Cause
1. The Next.js server process (`rateright-app.service`) had been running continuously since **Mar 6**
2. On Mar 13 someone ran `npm run build`, which regenerated the `.next` directory with new chunk hashes
3. The running process still had **old build manifests cached in memory** from startup
4. When browsers requested CSS/JS chunks, some hashes matched the on-disk files and returned 200 — others didn't, causing intermittent 500s and unstyled pages
5. **Key insight:** Next.js in production reads build manifests once at startup — a rebuild without a restart leaves the server serving stale references

## Fix Applied
```bash
systemctl restart rateright-app.service
```
Fresh process loaded current build manifests from the regenerated `.next` directory.

## Verification
- Service status: **active (running)**
- CSS asset checks: **5/5 returning 200** (98KB, `text/css`)
- Landing page: **200, fully styled**
- Browser console: **zero errors**

## Prevention
1. Added a **warning callout** to [[04-Operations/SOPs/Deployment SOP]] explaining why restart is mandatory after build
2. Changed the deploy command to a chained operation:
   ```bash
   npm run build && systemctl restart rateright-app.service
   ```
3. Added checklist items for **SSR process restart** and **asset verification** post-deploy
4. Rule: **Never run `npm run build` without restarting the service immediately after**

## Lessons
- **Next.js caches build manifests in memory at startup** — a new build means nothing until the process restarts
- **Intermittent failures are the worst kind** — some chunks match by coincidence, making the issue look random
- **Long-running Node processes + rebuilds = stale state** — always restart after any build step

## Time to Resolve
~15 minutes (once root cause identified)
