nextjs - 💡(How to fix) Fix `next/font/google`: "Failed to find font override values" for `Google Sans Flex` — missing from `capsize-font-metrics.json` [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#90176Fetched 2026-04-08 00:20:38
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
closed ×1commented ×1labeled ×1locked ×1

Using Google_Sans_Flex from next/font/google produces the following warning on every request:

Failed to find font override values for font `Google Sans Flex`
Skipping generating a fallback font.

The font itself is available on Google Fonts and loads correctly, but Next.js cannot generate a CSS fallback (ascent-override, descent-override, size-adjust) because Google Sans Flex is absent from the internal capsize-font-metrics.json database (currently 1,753 entries in v16.1.6).

Root Cause

packages/next/src/server/capsize-font-metrics.json does not contain an entry for Google Sans Flex. In fact, no Google Sans family fonts appear in the database at all.

Confirmed via:

const d = require('next/dist/server/capsize-font-metrics.json');
console.log(Object.keys(d).filter(k => k.includes('Google Sans')));
// []

Fix Action

Fix / Workaround

Both were closed without a systemic fix. The workaround (adjustFontFallback: false) suppresses the warning but does not generate a proper fallback, increasing CLS risk.

Code Example

Failed to find font override values for font `Google Sans Flex`
Skipping generating a fallback font.

---

// app/layout.tsx
import { Google_Sans_Flex } from "next/font/google";

const GoogleSansFlex = Google_Sans_Flex({
  subsets: ["latin"],
  display: "swap",
});

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body className={GoogleSansFlex.className}>{children}</body>
    </html>
  );
}

---

Failed to find font override values for font `Google Sans Flex`
Skipping generating a fallback font.

---

next: 16.1.6
react: 19.2.4
node: (latest LTS)

---

const d = require('next/dist/server/capsize-font-metrics.json');
console.log(Object.keys(d).filter(k => k.includes('Google Sans')));
// []
RAW_BUFFERClick to expand / collapse

Bug Report

Description

Using Google_Sans_Flex from next/font/google produces the following warning on every request:

Failed to find font override values for font `Google Sans Flex`
Skipping generating a fallback font.

The font itself is available on Google Fonts and loads correctly, but Next.js cannot generate a CSS fallback (ascent-override, descent-override, size-adjust) because Google Sans Flex is absent from the internal capsize-font-metrics.json database (currently 1,753 entries in v16.1.6).

Reproduction

// app/layout.tsx
import { Google_Sans_Flex } from "next/font/google";

const GoogleSansFlex = Google_Sans_Flex({
  subsets: ["latin"],
  display: "swap",
});

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body className={GoogleSansFlex.className}>{children}</body>
    </html>
  );
}

Console output:

 ⚠ Failed to find font override values for font `Google Sans Flex`
 ⚠ Skipping generating a fallback font.

Environment

next: 16.1.6
react: 19.2.4
node: (latest LTS)

Expected Behavior

next/font/google generates fallback CSS override values for Google Sans Flex, consistent with other Google Fonts.

Actual Behavior

Warning is printed and fallback font generation is skipped, leading to potential CLS (Cumulative Layout Shift) during font load.

Root Cause

packages/next/src/server/capsize-font-metrics.json does not contain an entry for Google Sans Flex. In fact, no Google Sans family fonts appear in the database at all.

Confirmed via:

const d = require('next/dist/server/capsize-font-metrics.json');
console.log(Object.keys(d).filter(k => k.includes('Google Sans')));
// []

Related Issues

  • #47115 — same root cause with Unbounded (closed)
  • #82079 — same root cause with Cascadia Mono (closed)

Both were closed without a systemic fix. The workaround (adjustFontFallback: false) suppresses the warning but does not generate a proper fallback, increasing CLS risk.

Suggested Fix

Add Google Sans Flex (and other missing Google Sans variants) to capsize-font-metrics.json, or implement dynamic fallback metric calculation via fontkit as previously suggested in #47115 (see the TODO comment in get-fallback-font-override-metrics.ts).

extent analysis

Quick Fix – Supply the missing fallback metrics yourself

Next.js only prints the warning because capsize-font-metrics.json has no entry for Google Sans Flex.
You can bypass the missing entry by passing the override values manually when you create the font.
That eliminates the warning and gives you a proper fallback, so CLS stays low.

// app/layout.tsx
import { Google_Sans_Flex } from 'next/font/google';

// 1️⃣  Compute the metrics once (see script below) and paste the numbers here.
const GoogleSansFlex = Google_Sans_Flex({
  subsets: ['latin'],
  display: 'swap',
  // 2️⃣  Tell Next to use these overrides instead of looking them up.
  fallback: {
    // values are percentages of the font’s em‑square (0‑100)
    ascentOverride: 92.5,   // ← example, replace with your own
    descentOverride: 22.5,  // ← example, replace with your own
    lineGapOverride: 0,     // optional
    size

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING