-
Notifications
You must be signed in to change notification settings - Fork 27k
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
next/font Roboto_Flex cannot have axis set #72413
Comments
@mclement18 Thank you for submitting an issue! Taking a look at this |
Thank you for your time but I found my mistake. I got confused in the doc at the I didn't realized that it was required to set the I was trying to do: const robot_flex = Roboto_Flex({
variable: '--roboto-flex',
style: 'normal',
weight: ['400', '700'], // using an array
display: 'swap',
preload: true,
subsets: ['latin', 'latin-ext', 'greek'],
axes: ['wdth'],
}); When I had to do: const robot_flex = Roboto_Flex({
variable: '--roboto-flex',
style: 'normal',
weight: 'variable', // just set it to 'variable`
display: 'swap',
preload: true,
subsets: ['latin', 'latin-ext', 'greek'],
axes: ['wdth'],
}); I only understood my mistake when I saw this line of code:
I guess that I read better code than English 😅 |
## Why? The current error message when you have have a set `weight: ['400', '700']` and set `axes: ['wdth']` for a variable font is confusing—it should mention to correct your weight property (e.g., `weight: 'variable'` or nothing at all for `weight`). - Fixes #72413
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Link to the code that reproduces this issue
https://github.com/mclement18/nextjs-font-bug-example
To Reproduce
npm run dev
Current vs. Expected behavior
I expect to be able to use the axes of the
Roboto_Flex
font since the type signature tells me that I can do it but I get the following error :Provide environment information
Operating System: Platform: linux Arch: arm64 Version: #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 19:27:11 UTC 2024 Available memory (MB): 17949 Available CPU cores: 12 Binaries: Node: 22.9.0 npm: 10.8.3 Yarn: 1.22.22 pnpm: 9.12.1 Relevant Packages: next: 15.0.3-canary.7 // Latest available version is detected (15.0.3-canary.7). eslint-config-next: N/A react: 19.0.0-rc-7c8e5e7a-20241101 react-dom: 19.0.0-rc-7c8e5e7a-20241101 typescript: 5.3.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), next build (local), next start (local)
Additional context
It does not work on the 14.2.17 release that we are using on our project.
The text was updated successfully, but these errors were encountered: