-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[turbopack] "Error: invalid type: string" when using variable on next/font #3139
Comments
I found the exact issue – seems like a wrong declaration? Not sure why the developer declare this as a
Changing |
I have the same issue. Can't use So this documentation breaks with turbopack: https://nextjs.org/docs/api-reference/next/font#css-variables |
/cc @wbinnssmith |
Fixes WEB-501 Fixes #3139 This adds proper support for the [`variable` property](https://nextjs.org/docs/api-reference/next/font#variable) when constructing fonts. This results in: * defining a selector in the css module for a classname defining the css custom property (css variable), whose value is the font family * adding a `variable` property to the resulting js object whose value is the classname used in the selector above Test Plan: Added an integration test.
Hello There, Still facing the same issue when setting fonts with tailwindcss according to below instructions: https://nextjs.org/docs/basic-features/font-optimization#with-tailwind-css |
…urbo#3505) Fixes WEB-501 Fixes vercel/turbo#3139 This adds proper support for the [`variable` property](https://nextjs.org/docs/api-reference/next/font#variable) when constructing fonts. This results in: * defining a selector in the css module for a classname defining the css custom property (css variable), whose value is the font family * adding a `variable` property to the resulting js object whose value is the classname used in the selector above Test Plan: Added an integration test.
…urbo#3505) Fixes WEB-501 Fixes vercel/turbo#3139 This adds proper support for the [`variable` property](https://nextjs.org/docs/api-reference/next/font#variable) when constructing fonts. This results in: * defining a selector in the css module for a classname defining the css custom property (css variable), whose value is the font family * adding a `variable` property to the resulting js object whose value is the classname used in the selector above Test Plan: Added an integration test.
What version of Turbopack are you using?
next: 13.1.1
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Linux
Describe the Bug
Using the variable property on next/font with Turbopack causes the following error:
[500] error: invalid type: string "--font-inter", expected a sequence at line 1 column 95
The font is declared as per the docs:
Important to note: this only happens when you add the variable property, and you don't have to apply the font style to the app to experience the issue, just declaring the font like so with variable property causes the app to crash.
Expected Behavior
The next/font with variable property works fine without Turbopack.
To Reproduce
Reproduction Repo
No response
The text was updated successfully, but these errors were encountered: