Requiring a variable font causes a type error
# Bug report When satori's .addFonts method is called, it calls opentype which (in a Next.js app) throws the following error ``` error - TypeError: Cannot read properties of undefined (reading '259') at parseFvarAxis (webpack-internal:///(middleware)/./node_modules/@shuding/opentype.js/dist/opentype.module.js:10290:22) at Object.parseFvarTable [as parse] (webpack-internal:///(middleware)/./node_modules/@shuding/opentype.js/dist/opentype.module.js:10326:13) at Object.parseBuffer [as parse] (webpack-internal:///(middleware)/./node_modules/@shuding/opentype.js/dist/opentype.module.js:11618:33) at vt.addFonts (webpack-internal:///(middleware)/./node_modules/satori/dist/esm/index.wasm.js:18:20138) at new vt (webpack-internal:///(middleware)/./node_modules/satori/dist/esm/index.wasm.js:18:19783) at mu (webpack-internal:///(middleware)/./node_modules/satori/dist/esm/index.wasm.js:18:49554) at Object.start (webpack-internal:///(middleware)/./node_modules/@vercel/og/dist/index.js:10:2973) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) ``` ## Description / Observed Behavior Could not load a variable font ## Expected Behavior The font loads ## Reproduction ```ts const font = fetch( new URL( 'path/to/GeneralSans-Variable.ttf', import.meta.url, ), ).then(async res => res.arrayBuffer()); // Then load with: const options = { fonts: [ { name: "General Sans", data: await font, style: "normal", }, ], };
Posted by alii on Oct 11, 2022, 1:14 AM
Tags
Related issues
- 2026 - Microsoft Office 365
- [Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
- Gamut mapping
- [Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
- [Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
- [BUG]: infinite loading of videos
Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments
github (SaaS)
2026 - Microsoft Office 365
[Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
Gamut mapping
[Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
[Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
[BUG]: infinite loading of videos
Restore GPT-5.6 Sol’s 372k Codex context window, or provide an opt-in setting
Codex Desktop for macOS repeatedly triggers `syspolicyd` / `trustd` CPU and memory runaway
Requiring a variable font causes a type error
# Bug report When satori's .addFonts method is called, it calls opentype which (in a Next.js app) throws the following error ``` error - TypeError: Cannot read properties of undefined (reading '259') at parseFvarAxis (webpack-internal:///(middleware)/./node_modules/@shuding/opentype.js/dist/opentype.module.js:10290:22) at Object.parseFvarTable [as parse] (webpack-internal:///(middleware)/./node_modules/@shuding/opentype.js/dist/opentype.module.js:10326:13) at Object.parseBuffer [as parse] (webpack-internal:///(middleware)/./node_modules/@shuding/opentype.js/dist/opentype.module.js:11618:33) at vt.addFonts (webpack-internal:///(middleware)/./node_modules/satori/dist/esm/index.wasm.js:18:20138) at new vt (webpack-internal:///(middleware)/./node_modules/satori/dist/esm/index.wasm.js:18:19783) at mu (webpack-internal:///(middleware)/./node_modules/satori/dist/esm/index.wasm.js:18:49554) at Object.start (webpack-internal:///(middleware)/./node_modules/@vercel/og/dist/index.js:10:2973) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) ``` ## Description / Observed Behavior Could not load a variable font ## Expected Behavior The font loads ## Reproduction ```ts const font = fetch( new URL( 'path/to/GeneralSans-Variable.ttf', import.meta.url, ), ).then(async res => res.arrayBuffer()); // Then load with: const options = { fonts: [ { name: "General Sans", data: await font, style: "normal", }, ], };
Comments (0)
No comments yet. Start the discussion.