font not working
Answered
Shaurya posted this in #help-forum
ShauryaOP
import "@styles/main/globals.css"
import Nav from "@/components/main/nav"
import { Montserrat } from "next/font/google"
const montserrat = Montserrat({ subsets: ["latin"] })
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body className={montserrat.className}>
<Nav />
{children}
</body>
</html>
)
}why isn't the font working?I didn't change anything but it's suddenly showing the fallback font
10 Replies
is the file downloaded in dev tools (network), any errors in server console, and any confliting syles for fonts in CSS
and in the [docs](https://nextjs.org/docs/app/building-your-application/optimizing/fonts#google-fonts), they mention "variable fonts", is this font one of them?
@riský is the file downloaded in dev tools (network), any errors in server console, and any confliting syles for fonts in CSS
ShauryaOP
yes the file is downloaded, no errors in console, I've set the font only here not in css
and dev or pod mode?
ShauryaOP
dev mode
try prod and see if it works...
but it should work
also try new browser (/clear cache for page)
Answer
ShauryaOP
clearing cache works
@Shaurya clearing cache works
lol why does this have to be the cause of many things (but always forgotten about) ðŸ˜