Skip to content

next/font no longer works with "Inter" and "slnt" axes enabled #68395

@stefanprobst

Description

@stefanprobst

Link to the code that reproduces this issue

https://github.com/stefanprobst/issue-next-fonts-inter-slnt

To Reproduce

clone repo, install deps, run pnpm run build.

see error message:

Failed to fetch `Inter` from Google Fonts.}
Failed to fetch font `Inter`.
URL: https://fonts.googleapis.com/css2?family=Inter:slnt,[email protected],100..900&display=swap

Please check if the network is available.

Retrying 1/3...
Failed to fetch font `Inter`.
URL: https://fonts.googleapis.com/css2?family=Inter:slnt,[email protected],100..900&display=swap

Please check if the network is available.

Retrying 2/3...
Failed to fetch font `Inter`.
URL: https://fonts.googleapis.com/css2?family=Inter:slnt,[email protected],100..900&display=swap

Please check if the network is available.

Retrying 3/3...
Error [NextFontError]: Failed to fetch font `Inter`.
URL: https://fonts.googleapis.com/css2?family=Inter:slnt,[email protected],100..900&display=swap

Please check if the network is available.

Current vs. Expected behavior

font download should work (as it did until recently)

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 15 16:40:02 UTC 2
  Available memory (MB): 15893
  Available CPU cores: 4
Binaries:
  Node: 20.16.0
  npm: 10.8.1
  Yarn: N/A
  pnpm: 9.6.0
Relevant Packages:
  next: 14.2.5 // Latest available version is detected (14.2.5).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.5.4
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 build (local)

Additional context

see google/fonts#7985 for upstream changes

when downloading Inter directly from google, the embed link is:

https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap

while next/font tries the following url, which now fails:

https://fonts.googleapis.com/css2?family=Inter:slnt,[email protected],100..900&display=swap

Metadata

Metadata

Assignees

No one assigned

    Labels

    Font (next/font)Related to Next.js Font Optimization.bugIssue was opened via the bug report template.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions