nextjs - 💡(How to fix) Fix localFont function from next/font isn't taking array of strings [2 comments, 1 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#92675Fetched 2026-04-12 13:23:16
View on GitHub
Comments
2
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
commented ×2issue_type_added ×1labeled ×1renamed ×1

Fix Action

Fix / Workaround

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.

Code Example

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
RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

The issue can likely be resolved by modifying the localFont function to support multiple weights or using a workaround such as patching the package.

Guidance

  • Review the localFont function implementation to understand how it handles font weights and consider modifying it to support multiple weights.
  • Investigate the issues encountered when using patch-package to fix the localFont issue, as it may provide a temporary workaround.
  • Check the Next.js documentation for any updates or guidance on using localFont with multiple weights.
  • Consider testing with a different version of Next.js or localFont to see if the issue is version-specific.

Example

No code snippet is provided as the issue does not include the implementation details of the localFont function.

Notes

The issue may be specific to the localFont function implementation or the version of Next.js being used. Further investigation is needed to determine the root cause.

Recommendation

Apply workaround: The use of patch-package may provide a temporary solution, but it is recommended to investigate and address the underlying issue with the localFont function.

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

nextjs - 💡(How to fix) Fix localFont function from next/font isn't taking array of strings [2 comments, 1 participants]