mirror of
https://github.com/bitbaum/vitareba.git
synced 2026-12-04 15:47:36 +01:00
next/font/google downloads the font files AT BUILD TIME. Every build — CI, and
the production deploy on the box — was therefore a request to
fonts.gstatic.com, and shipping depended on Google answering from wherever the
build happened to run.
It failed three times this afternoon: twice on the box mid-deploy, once on a
GitHub runner. Each time it surfaced as
Module not found: '@vercel/turbopack-next/internal/font/google/font'
which reads like a broken import and is really a failed download, so the person
who meets it goes looking in entirely the wrong place. One of those failures
left the patient portal down for an extra ten minutes while the fix sat waiting
on a font.
The seven faces this site uses are now committed to public/fonts and loaded
through next/font/local. Builds are hermetic, deploys stop depending on a third
party, and the typography cannot change without a diff. 133 KB, latin subset
only, which is what the site renders.
The gate is app/fonts.test.ts, and it checks two different things:
• Nothing imports from next/font/google, so the network dependency cannot
come back by habit.
• Every vendored file is really a woff2 — magic bytes and a plausible size —
and every face the layout references is present. Google serves an HTML
error page on failure, and an HTML file named .woff2 commits fine, builds
fine, and silently renders a fallback typeface to every patient. That is a
worse failure than the build breaking, because nothing reports it.
1229 passing; build green.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>