今日已更新 339 条资讯 | 累计 19899 条内容
关于我们

Friday Fixes: The Fix That Wasn't

Rob 2026年06月26日 23:35 2 次阅读 来源:Dev.to

Three bugs this month. All three looked fixed before they broke. The date was quoted in 51 out of 52 posts. The model was pinned to a specific version. The upload feature had been working in production for weeks. Each one passed the obvious checks and failed somewhere else. That's the theme for this Friday Fixes: the fix that wasn't. Not bugs that went unnoticed, but bugs where a defense existed and the failure found its way around it. 1. The Unquoted Date, Part Two If this one sounds familiar, it should. I wrote an entire Friday Fixes post about this exact bug class five weeks ago. An unquoted YAML date. gray-matter parsing it as a Date object instead of a string. A crash downstream. Last time it took down /admin/drafts . The fix hardened formatDate() to coerce Date objects before calling .includes() . I verified it. I shipped it. I wrote 2,000 words about it. I moved on. This time it took down the homepage. The symptom: vibescoder.dev loaded for a split second, then flashed to Chrome's "This page couldn't load" screen. Every browser, every profile, every device. The site was completely dead to visitors. The twist: curl returned HTTP 200 with ~900KB of fully rendered HTML. The server was fine. The crash was happening during React hydration in the browser, invisible to any server-side test. The cause: A new post had date: 2026-06-19 in its frontmatter. No quotes. gray-matter parsed it as a Date object. In posts.ts , the code does const meta = data as PostMeta and then spreads ...meta into the return value. The as PostMeta cast told TypeScript the date was a string . At runtime, it was a Date . That Date object flowed through the server component, through the RSC serialization boundary, and into PostListWithFilters , a "use client" component. React couldn't hydrate it. No global-error.tsx existed to catch the crash. Dead page. Why the May fix didn't prevent this: Because the May fix was in the wrong layer. It hardened formatDate() , the function that happened to cras

本文内容来源于互联网,版权归原作者所有
查看原文