Importing font from 'next/font/google' spikes compilation times in development
Unanswered
Spectacled bear posted this in #help-forum
Spectacled bearOP
The font import (cause of issue)
Code change made with import (slow)
Code change made with import commented out (fast)
I'm on the latest Nextjs version and this codebase is pretty tiny with hardly any dependencies. I'm confident I've narrowed the problem to this line of code but I have no idea why it's the cause.
Any suggestions are greatly appreciated lmk if I should share more details.
import { Archivo_Narrow } from 'next/font/google';
export const archivoNarrow = Archivo_Narrow({ subsets: ['latin'] });
Code change made with import (slow)
✓ Compiled / in 33.2s
Code change made with import commented out (fast)
✓ Compiled / in 11ms
I'm on the latest Nextjs version and this codebase is pretty tiny with hardly any dependencies. I'm confident I've narrowed the problem to this line of code but I have no idea why it's the cause.
Any suggestions are greatly appreciated lmk if I should share more details.
8 Replies
✓ Compiled in 39s
I don't understand why
in next 14 the compile after code change was 2-3 sec
now 39sec
lol why
how
@Crucian carp hey
Asian black bear
Don't hijack threads that are very likely completely unrelated to your issues.