vercel / vercel/next.js

adjustFontFallback is not working with Google Fonts in Next.js 15

Open
#74,134 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Font (next/font)
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/sweet-moon-yzv9yt

To Reproduce
  1. Import any font from fonts/google
  2. Set adjustFontFallback to false
  3. Apply className of font to body
  4. Check if font fallback is applied in the inspector
Current vs. Expected behavior

Current behavior: font fallback is always provided regardless of the adjustFontFallback value
Expected behavior: font fallback should only be applied when adjustFontFallback is true. When it's false it should not be applied

Provide environment information
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 16272
  Available CPU cores: 12
Binaries:
  Node: 20.17.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.1.1-canary.1 // Latest available version is detected (15.1.1-canary.1).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
Next.js Config:
  output: N/A
Which area(s) are affected? (Select all that apply)

Font (next/font)

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

adjustFontFallback is working correctly in Next.js 14. However, after updating and not touching the font import and config code, it's not working.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and inspect the next/font Google Fonts usage of adjustFontFallback. Compare the behavior between Next.js 14 and the reported Next.js 15.1.1-canary.1 environment. Done means fallback styles appear only when adjustFontFallback is true, including in next dev.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, next.js, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.