I encountered a similar issue related to fonts:
The preloaded font with link preload was not being utilized within a short timeframe. It's important to ensure all attributes of the preload tag are configured correctly.
To resolve this, I decided to remove any unused font declarations.
Previously, my code included:
import { Inter, Roboto, Sora } from 'next/font/google
export const inter = Inter({
subsets: ['latin'],
display: 'swap',
variable: '--font-inter'
})
export const roboto = Roboto({
subsets: ['latin'],
display: 'swap',
variable: '--font-roboto',
weight: '500'
})
export const sora = Sora({
subsets: ['latin'],
display: 'swap',
variable: '--font-sora'
})
After making changes (now using only the Inter font in my NextJS project):
import { Inter } from 'next/font/google
export const inter = Inter({
subsets: ['latin'],
display: 'swap',
variable: '--font-inter'
})
This adjustment aligns with the recommendations outlined in the official documentation for utilizing multiple fonts in a NextJS Vercel Project:
https://nextjs.org/docs/app/building-your-application/optimizing/fonts#using-multiple-fonts