Nextjs is NOT PRELOADING FONTS in SSG mode OUTSIDE VERCEl #78426
Unanswered
finniagents
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This same exact piece of code, is generating two very different outcomes when deployed online, I'm using SSG mode ( output export ) in both cases, but the version deployed to vercel DOES preload fonts, anywhere else such as Netlify & Cloudflare pages it doesn't!!!
I simply run npm run build, then drag and drop the out folder to netlify, and every single time, it skips the fonts to long long after the page has fully loaded, which creates a horrible issue.
import "./globals.css";
import FooterParent from "@/app/components/Shared/Footer/Footer";
import NavWrapper from "@/app/components/Navbar/NavWrapper";
import { Arima, Montserrat } from "next/font/google";
const arima = Arima({
subsets: ["latin"],
preload: true,
display: "block",
variable: "--font-ar",
});
const mont = Montserrat({
subsets: ["latin"],
preload: true,
display: "block",
variable: "--font-mn",
});
export default function RootLayout({ children }) {
return (
<html
lang="en"
suppressHydrationWarning
className={
${arima.variable} ${mont.variable}
}>
<body className={
antialiased pt-[75px] md:pt-[85px] xl:pt-[100px]
}>);
}
Beta Was this translation helpful? Give feedback.
All reactions