#Getting Font download errors on Vercel

14 messages · Page 1 of 1 (latest)

undone tusk
#

We're running into the following issue this morning:

[CannotFetchFontFile] [astro:fonts] An error occurred while fetching the font file from https://fonts.bunny.net/jetbrains-mono/files/jetbrains-mono-greek-400-italic.woff
  Hint:
    This is often caused by connectivity issues. If the error persists, open an issue at https://github.com/withastro/astro/issues.
  Error reference:
    https://docs.astro.build/en/reference/errors/cannot-fetch-font-file/
  Stack trace:
    at Object.handle (file:///vercel/path1/node_modules/.pnpm/astro@5.14.4_@planetscale+database@1.19.0_@types+node@24.7.2_@vercel+functions@3.1.3_idb-keyv_2xwahafm4jszsp7z2d6gx65mdu/node_modules/astro/dist/assets/fonts/implementations/error-handler.js:35:14)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at listOnTimeout (node:internal/timers:549:9)
    at async cache (file:///vercel/path1/node_modules/.pnpm/astro@5.14.4_@planetscale+database@1.19.0_@types+node@24.7.2_@vercel+functions@3.1.3_idb-keyv_2xwahafm4jszsp7z2d6gx65mdu/node_modules/astro/dist/assets/fonts/utils.js:46:16)
    at async file:///vercel/path1/node_modules/.pnpm/astro@5.14.4_@planetscale+database@1.19.0_@types+node@24.7.2_@vercel+functions@3.1.3_idb-keyv_2xwahafm4jszsp7z2d6gx65mdu/node_modules/astro/dist/assets/fonts/vite-plugin-fonts.js:267:28
  Caused by:
  fetch failed
    at node:internal/deps/undici/undici:14900:13
    at runNextTicks (node:internal/process/task_queues:69:3)
    at process.processTimers (node:internal/timers:523:7)
    at async cache (file:///vercel/path1/node_modules/.pnpm/astro@5.14.4_@planetscale+database@1.19.0_@types+node@24.7.2_@vercel+functions@3.1.3_idb-keyv_2xwahafm4jszsp7z2d6gx65mdu/node_modules/astro/dist/assets/fonts/utils.js:46:16)
    at async file:///vercel/path1/node_modules/.pnpm/astro@5.14.4_@planetscale+database@1.19.0_@types+node@24.7.2_@vercel+functions@3.1.3_idb-keyv_2xwahafm4jszsp7z2d6gx65mdu/node_modules/astro/dist/assets/fonts/vite-plugin-fonts.js:267:28
 ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
#

pinging @wise ginkgo 🙂

wise ginkgo
#

I hoped the stacktrace would be more useful...

#

It works locally for you right?

undone tusk
#

yea

#

and if i open the URL in the browser it starts downloading it, too

wise ginkgo
#

Can you try updating your astro config so it fetches this file? eg.

import { defineConfig } from '...'

const res = await fetch("https://fonts.bunny.net/jetbrains-mono/files/jetbrains-mono-greek-400-italic.woff")
console.log(res.status)

export default defineConfig({

})

Basically I want to see if it's Astro specific

undone tusk
#

and have that be deployed on vercel, too?

wise ginkgo
#

Yes 👍

#

We'll see if it fails during the build phase

undone tusk
wise ginkgo
#

Great! Honestly no idea, we literally just do a fetch call

#

Btw if I coded this well, the font files are cached in node modules and since vercel restores the node modules, it shouldn't re download these files

undone tusk