Skip to content

localFont function from next/font isn't taking array of strings #92675

@codayon

Description

@codayon

Link to the code that reproduces this issue

https://github.com/codayon/local-font-weight

To Reproduce

  1. npx create-next-app@canary
  2. create app/fonts.ts
  3. import localFont function and make an instance
  4. try adding multiple weights in array of strings
  5. face the issue

Current vs. Expected behavior

localFont instances doesn't have the permission to add multiple weights while google fonts do. localFont instances should also be able to add multiple fonts.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 16209
  Available CPU cores: 16
Binaries:
  Node: 25.9.0
  npm: 11.12.1
  Yarn: 1.22.22
  pnpm: 10.33.0
Relevant Packages:
  next: 16.2.1-canary.33 // Latest available version is detected (16.2.1-canary.33).
  eslint-config-next: N/A
  react: 19.2.5
  react-dom: 19.2.5
  typescript: 5.9.3
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

I tried using using patch-package, which fixes this issue, but I'm facing a few more issues with localFont, so I'm not sure if things are working as expected.

Reference: https://nextjs.org/docs/app/api-reference/components/font

Metadata

Metadata

Assignees

No one assigned

    Labels

    Font (next/font)Related to Next.js Font Optimization.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions