Next.js Discord

Discord Forum

next font not loading in production

Unanswered
Beveren posted this in #help-forum
Open in Discord
BeverenOP
Hello everyone, I got a weird bug. I am using a next/font/google that loads locally but not in production.

// layout.tsx
const fontRobotoSlab = Roboto_Slab({
subsets: ["latin"],
weight: ["400", "600", "700"],
variable: "--font-roboto-slab",
display: "swap",
});

// global.css
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: var(--font-roboto-slab), serif;
}

It is loading the font but not using it.
I am using docker and standalone mode to deploy it in a VPS server

0 Replies