-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documented use of Google Fonts via next/head generates a warning in development mode #34693
Closed
1 task done
Labels
bug
Issue was opened via the bug report template.
Font (next/font)
Related to Next.js Font Optimization.
Comments
balazsorban44
added
Font (next/font)
Related to Next.js Font Optimization.
area: documentation
labels
Feb 22, 2022
kara
added a commit
to kara/next.js
that referenced
this issue
Feb 22, 2022
The Font Optimization docs have an outdated example that recommends adding fonts via `next/head`. This is an anti-pattern that Next.js has already warned about through ESLint for a while (see https://nextjs.org/docs/messages/no-page-custom-font) and is now starting to warn about through the console because it won't work well with streaming architecture. This change removes the outdated example from the docs. Fixes vercel#34693
1 task
kodiakhq bot
pushed a commit
that referenced
this issue
Feb 22, 2022
The Font Optimization docs have an outdated example that recommends adding fonts via `next/head`. This is an anti-pattern that Next.js has already warned about through ESLint for a while (see https://nextjs.org/docs/messages/no-page-custom-font) and is now starting to warn about through the console because it won't work well with streaming architecture. This change removes the outdated example from the docs. Fixes #34693 ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint`
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bug
Issue was opened via the bug report template.
Font (next/font)
Related to Next.js Font Optimization.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
next start
Describe the Bug
When a Google Fonts stylesheet is included in a page by following the font optimization documentation, a warning is generated in the browser console in development mode:
Do not add stylesheets using next/head (see <link rel="stylesheet"> tag
.Expected Behavior
I would expect any of:
Document
(For my use case, never warning on hosted fonts and/or ignoring the warning would be ideal, as I'd like to be able to allow different fonts on a per-page basis, and because the failure cases are unlikely to apply.)
To Reproduce
Include
in a page in development mode. Observe the warning in the console.
The text was updated successfully, but these errors were encountered: