Error building tailwind.css when trying to install custom typeface font #3114
-
I am trying to add Roboto font to my basic sans fontFamily by extending it. require("typeface-roboto");
When I try to build the file with tailwind CLI, I run into this error:
Following this guide here. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey! Are you able to share your code project? Where are you requiring the require("typeface-roboto"); I have just made a test project with NextJS and I extended the Here's the repo: https://github.com/simonswiss/tailwind-roboto-font-example If you can share your code setup, I'll take a look for you. |
Beta Was this translation helpful? Give feedback.
-
@simonswiss Thank you so much! To confirm, I was trying to import it in the tailwind.config.js file, so that's why it was not working. As for the other unrelated issue where it seemed the font wasn't changing: when I installed tailwind, I ran npx tailwind tailwind.js --full, so I needed to edit my tailwind.js file instead of a tailwind.config.js file. It all works now, again thanks and closing this! |
Beta Was this translation helpful? Give feedback.
Hey!
Are you able to share your code project?
Where are you requiring the
typeface-roboto
package?I have just made a test project with NextJS and
create-next-app
. I added the font via thetypeface-roboto
npm package, required it in my_app.js
layout (so it's available on all pages).I extended the
fontFamily
object with alogo
font, just like you mentioned, and it all works 👍Here's the repo:
https://github.com/simonswiss/tailwind-roboto-font-example
If you can share your code setup, I'll take a look for you.