$ cat ~/writing/til/next-font-google-flakes-ci.md
next/font/google can fail your CI build
next/font/google downloads fonts at build time, so a network blip fails the build. Self-hosting fixed it.
- written
- tags
- nextjs · ci · fonts
A CI build failed once with this, then passed on a rerun:
Can't resolve '@vercel/turbopack-next/internal/font/google/font'
next/font/google fetches the font files during next build. If that fetch fails, so does the build. I swapped to next/font/local with the files committed, kept the same CSS variables, and builds no longer need the network for fonts.