-
Notifications
You must be signed in to change notification settings - Fork 27.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Failed to load font file, Unknown font format when using next/font/local #74071
Comments
Fixed with downgrading node from 23 to 22 |
Is there a fix for people using node 23? |
this should be opened - having this issue as well |
Done, if tou can please add reproduction link, ive deleted mine, sorry |
looks to be upstream in fontkit: foliojs/fontkit#356 |
I am having this issue with bun 1.1.42 and node 23.4.0. Trying to load the font using: import localFont from "next/font/local";
export const outfit = localFont({
src: "../public/fonts/outfit.ttf",
preload: true,
variable: "--font-outfit",
}); results in:
Also tried with |
This works normally until Node 23.4.0: const vivo_sans = localFont({
src: [
{ path: "Font/vivoSans-Regular.ttf", weight: '500' },
{ path: "Font/vivoSans-Bold.ttf", weight: '700' },
],
variable: '--font-vivo-sans',
}) Failed to load font file: Font/vivoSans-Bold.ttf Retrying 1/3... Retrying 1/3... Retrying 1/3... <--- Last few GCs ---> [506930:0x5f63b7b4e000] 208231 ms: Scavenge (interleaved) 6435.6 (6444.3) -> 6432.7 (6452.8) MB, pooled: 0 MB, 7.87 / 0.00 ms (average mu = 0.229, current mu = 0.186) allocation failure; <--- JS stacktrace ---> FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 0x5f639c7edd95 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [next-server (v14.2.15)] |
Upgrading to Node v23.5.0 solved this issue for me. |
Fixed in Node v23.5.0 |
Link to the code that reproduces this issue
https://github.com/milkyfuckinway/next-error-unknown-font-format
To Reproduce
Current vs. Expected behavior
Expect no errors
Provide environment information
Which area(s) are affected? (Select all that apply)
Font (next/font)
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: