Next.js Discord

Discord Forum

Variable font in vercel og

Unanswered
Abyssinian posted this in #help-forum
Open in Discord
AbyssinianOP
How to load a variable font such as Geist[wght].ttf in vervel og?
I am trying to load is like this:
fonts: [
    {
        name: 'Geist',
        data: await fetch(
            new URL(`${origin}/GeistMono[wght].ttf`)
        ).then(res => res.arrayBuffer()),
        weight: 800,  // Base weight
        style: 'normal',
    }
]

but getting this error:
Error: failed to pipe response
    at ignore-listed frames {
  [cause]: TypeError: Cannot read properties of undefined (reading '256')
      at ignore-listed frames
}
 GET /api/og?username=meow 500 in 70ms (compile: 1714µs, render: 68ms)

0 Replies