next.js
fa8dcf34 - Turbopack: report next/font/google font file fetch failures instead of Module not found (#99574)

Commit
4 days ago
Turbopack: report next/font/google font file fetch failures instead of Module not found (#99574) Fixes #97378 ### What? Turbopack turns a failed `next/font/google` font file download into an unresolvable request. Build then dies with: ``` Module not found: Can't resolve '@vercel/turbopack-next/internal/font/google/font' ``` Real cause (`Received response with status 404 when requesting <url>`) shows only as a warning earlier in the log. ### Why? Hit this on Vercel with 16.3.6 and EB Garamond. Build failed with 56 of these errors, redeploy of same commit passed. Nothing in the error pointed at the font download. ### How? Font file fetch now follows the stylesheet fetch: error in `next build`, warning in `next dev`. A failed file is served empty, so dev falls back to the next font in the stack. Retries unchanged; `max_retries: 1` already covers connect errors, timeouts and 5xx. Differs from #97520: dev keeps rendering instead of failing, message comes from the existing fetch issue, and global retry count and webpack mock stay as they are. ### Tests `test/e2e/next-font/google-font-file-fetch-error.test.ts`, Turbopack only, since webpack in mock mode does not download font files. Mocked stylesheet points at a missing gstatic file. Without the fix both dev and start fail with `Module not found`. With it both pass. `google-fetch-error` and `index` next-font suites still pass in Turbopack dev and start. `cargo clippy -D warnings`, rustfmt, prettier and eslint clean.
Author
Parents
Loading