Next.js Discord

Discord Forum

Font changes on production

Answered
Jersey Wooly posted this in #help-forum
Open in Discord
Avatar
Jersey WoolyOP
const inter = Inter({ subsets: ["latin"] });

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  const queryClient = new QueryClient({
    defaultOptions: {
      mutations: {
        retry: false
      }
    }
  });

  return (
    <html lang="en">
      <body className={inter.className}>
        <QueryClientProvider client={queryClient}>
          {children}
        </QueryClientProvider>
      </body>
    </html>
  );
}

so i have this piece of code which is the root layout, as you can see the inter font is applied, and it works in dev but not production. why could this be? is it because it's a client component?

and yes, im sure the font is changing because i use a tool to check the font being rendered (i get system-ui)
Answered by Jersey Wooly
confirmed this is an issue with being a client-side component. switching to ssr componente makes it normal again.
View full answer

1 Reply

Avatar
Jersey WoolyOP
confirmed this is an issue with being a client-side component. switching to ssr componente makes it normal again.
Answer