Next.js downloads from fonts.googleapis.com during build #68907
Unanswered
DiskCrasher
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
One of my build environments blocks access to the Internet. Next.js attempts to download from fonts.googleapis.com during build when a font is imported from
next/font/google. This results in a failed build since the URL cannot be accessed.A workaround is to add the font files directly to my project but this is not ideal because they would need to be manually updated if/when revisions are made upstream. Next.js should not be secretly accessing the Internet during builds.
Additional information
Next.js documentation states that
next/fontis "built in" with no indication that it will be downloaded during build:"From version 13.2 onward,
next/fonthas been built into Next.js, making the@next/fontpackage redundant. The@next/fontpackage will be completely removed in Next.js 14."https://nextjs.org/docs/messages/built-in-next-font
Example
Beta Was this translation helpful? Give feedback.
All reactions