mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #72] next/font/google shim missing named exports for fonts like Figtree, DM_Sans, etc. #21
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @solracnyc on GitHub (Feb 25, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/72
Environment
vinext devReproduce
import { Figtree } from 'next/font/google'vinext build→ fails with something like"Figtree" is not exported by ".../shims/font-google.ts"Interin a Server Component layout works fine because the shim does export it (or handles it as default).Root cause
The font shim (source) does not export
Figtree(or other Google Fonts likeDM_Sans,Poppins, etc.) as named exports. Only a subset of fonts appear to be shimmed.This affects any app using non-default Google Fonts via
next/font/googlenamed imports.Workaround
Replace the
next/font/googleimport with a CSS@importfrom Google Fonts CDN:Then use
font-family: 'Figtree', system-ui, sans-serifdirectly in CSS instead of the JS font object'sclassName.Suggested fix
Either generate named exports for all Google Fonts (matching Next.js behavior), or document the CSS
@importworkaround as the recommended approach for fonts beyond the currently shimmed set.Verified on 0.0.8 — the font shim source still lacks these named exports.