Menu

The ampersand that broke next/font/google is still in our repo, in the one script that renders our social card
📰

The ampersand that broke next/font/google is still in our repo, in the one script that renders our social card

DEV Community: nextjs·Daniel Pertu·3 days ago
#hV6JfPRN
#devtonextjs#devto#dev#font#fonts
Reading 0:00
15s threshold

A week ago I wrote about next/font/google breaking on an ampersand , which is how Notifio ended up with two woff2 files committed into the repository. The comment that survived that change is still at the top of the root layout:

// Self-hosted latin variable fonts (Google Fonts). next/font/google in Turbopack // fails the build whenever Google serves a font URL containing "&". const spaceGrotesk = localFont ({ src : " ./fonts/space-grotesk-latin.woff2 " , variable : " --font-space-grotesk " , weight : " 300 700 " , display : " swap " , preload : true , });

Enter fullscreen mode

Exit fullscreen mode

Two of those, Space Grotesk and DM Sans, plus Geist Mono from the geist package. Three typefaces, 59KB of woff2 in src/app/fonts/ , nothing fetched from Google at build time or at request time.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.