Back to blog
EngineeringDate unavailable· min read

The 404 We Shipped to Production (And How We're Making Sure It Never Happens Again)

Two broken product page URLs made it to production. Here's what broke, how we caught it, and the audit test that now prevents URL mismatches from shipping again.

We shipped two broken URLs to production. /products/strugworks and /products/antistrug both returned 404s. The actual routes are /products/strug-works and /products/anti-strug — with hyphens.

This wasn't a routing bug. It was a hard-coded string bug. ProductCard and ClosingCTASection components had hand-typed URLs instead of using the centralized SLUG_TO_PAGE_ROUTE mapping utility.

What Actually Broke

The marketing site uses kebab-case slugs for product pages: strug-works, anti-strug, sabine, feedtumi, poppin. We have a utility function in src/app/products/utils.ts that maps product slugs to their full routes. It's the source of truth.

Somewhere along the way, a developer (probably me, or one of the Strug Works frontend agents) hard-coded URLs in two components instead of using the utility. When you clicked "Learn More" on the Strug Works or Anti-Strug product cards, you hit a 404.

It shipped because we didn't have an audit test enforcing URL consistency across components.

The Fix

SC-Frontend corrected the hard-coded URLs in ProductCard.tsx and ClosingCTASection.tsx to reference the SLUG_TO_PAGE_ROUTE utility. Now those components pull from the same source of truth as the rest of the routing layer.

More importantly, we added a TDD audit test to __tests__/products-page.audit.test.ts that validates every product slug in the catalog resolves to a valid route. If anyone tries to ship a mismatched URL again, CI will catch it before merge.

What's Next

This is the fourth time in two weeks that a TDD audit test has caught or prevented a production issue: WCAG contrast violations, missing OG metadata, hardcoded navigation paths, and now broken product URLs.

The pattern is working. We're encoding architectural guardrails as executable tests that run on every commit. When an agent (or I) violates a constraint, CI blocks the merge and the agent auto-fixes.

Next up: we're expanding audit coverage to include link integrity checks across all marketing pages, not just product routes. If a CTA points to a nonexistent route, we want CI to fail before the PR is even opened.

Broken links are table stakes bugs. The interesting part isn't that we fixed them — it's that we're teaching the system to never let them ship again.