AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

AdjustFontFallback=False Ignored For Google Fonts In Next.Js 15

When using next/font/google with adjustFontFallback: false, the generated CSS still includes the automatic fallback font family, causing the fallback to always be applied. This is a regression from Next.js 14.

highConfidence 85%Next.jsAffected V15.0.0Affected V15.1.1-Canary.1

Origin Analysis

In Next.js 15, the Google Font loader fails to conditionally include the auto-generated fallback font when adjustFontFallback is set to false. The generated font-family CSS property always appends the fallback font, regardless of the option.
1. Create a Next.js 15 project (e.g., 15.1.1-canary.1). 2. Import a Google font using next/font/google, setting adjustFontFallback: false. 3. Apply the returned className to the body element. 4. Open browser devtools and inspect the computed font-family on body. 5. Observe that a fallback font family is included even though adjustFontFallback is false.

Fixing Code Block

Edge Case Audit

This inline style may be overridden by other CSS rules with higher specificity or break if inter.style.fontFamily is undefined in certain Next.js versions. It only handles a single font applied to the body; multiple fonts or component-level usage need similar handling. To roll back, remove the inline style and retain the original className. Upgrading to an official fixed version is strongly recommended instead of relying on this workaround long-term.

Ecosystem Topology