fix(og): read the home OG font from disk instead of fetching it at build time - #71
fix(og): read the home OG font from disk instead of fetching it at build time#71santifer wants to merge 1 commit into
Conversation
…ild time The 7 September build failed with ETIMEDOUT while prerendering /opengraph-image, and the whole deployment exited with it. The route was fetching its font from fonts.gstatic.com, so every build depended on a third party being reachable at that instant, and a route that renders one static image could take the deployment down. It happened on a preview; nothing stops it happening on a production deploy. The sibling route under manifesto/s/[username] already vendors its font on disk, with a comment explaining why. This applies the same pattern to the home route. The vendored file is the exact bytes that URL served, so the image is unchanged: the render from this build is byte-identical to the one production serves today, 651,455 bytes, same SHA-256. Note it is NOT the same file the manifesto route vendors, which is a different cut of the same family at 69,312 bytes, so the two are kept separate rather than shared. The path is added to outputFileTracingIncludes. Without that the build would stay green and the route would fail at runtime instead, which is the worse failure of the two. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BcPLgMFMs2B4SJv3vfq8jv
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe home Open Graph route now reads Instrument Serif from a local TTF file. Next.js configuration includes the font file in the route’s traced deployment bundle. ChangesOpen Graph font loading
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The home OG route now uses a bundled font, avoiding build-time third-party network failures. Reported build and route checks show no merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Found while checking whether Vercel had a problem. Production is healthy; this is a build reliability fix.
What happened
The 7 September deployment failed:
The home OG route fetched its font from
fonts.gstatic.comat build time. Every deployment therefore depended on Google being reachable at that exact moment, and a route whose only job is to render one static image could bring the whole build down.It happened on a preview this time. Nothing about it is preview-specific.
The fix already existed in this repo
src/app/manifesto/s/[username]/opengraph-image.tsxvendors its font on disk and says why in a comment. This applies the same pattern to the home route.The image does not change
Verified rather than assumed: the OG rendered from this build is byte-identical to what production serves today.
career-ops.org/opengraph-image-12gd74The vendored file is the exact bytes that URL served (62,284). Worth noting it is not the same file the manifesto route vendors, which is a different cut of the same family at 69,312 bytes, so they stay separate rather than being shared.
The part that is easy to miss
The font path is added to
outputFileTracingIncludes. Without it the build would go green and the route would 500 at runtime instead, which is the worse of the two failures: a broken OG image is invisible until someone shares a link.Verification
tsc --noEmitclean, production build cleanimage/pngfrom a fresh build🤖 Generated with Claude Code
https://claude.ai/code/session_01BcPLgMFMs2B4SJv3vfq8jv
Summary by CodeRabbit