Next.js Discord

Discord Forum

Next font error - Cannot read properties of undefined (reading 'ascent')

Unanswered
Manx posted this in #help-forum
Open in Discord
ManxOP
I am getting errors when running a next js app when run using create-next-app

yarn run v1.22.19
$ next dev
▲ Next.js 14.2.8
- Local: http://localhost:3000
- Environments: .env.local

✓ Starting...
✓ Ready in 6.4s
○ Compiling /_not-found ...
Failed to load font file: C:...\app\fonts\GeistVF.woff
RangeError: Offset is outside the bounds of the DataView
Failed to load font file: C:...\app\fonts\GeistVF.woff
RangeError: Offset is outside the bounds of the DataView
⨯ app\layout.tsx
An error occurred in next/font.

TypeError: Cannot read properties of undefined (reading 'ascent')
at get ascent [as ascent] (C:...\node_modules\next\dist\compiled@next\font\dist\fontkit\index.js:1:797933)

Commenting out this segment works:
// const geistMono = localFont({
// src: "./fonts/GeistMonoVF.woff",
// variable: "--font-geist-mono",
// weight: "100 900",
// });

5 Replies