Skip to content

Pre-transform error: fetch failed #574

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

Open
productdevbook opened this issue Mar 19, 2025 · 5 comments · May be fixed by unjs/fontaine#499
Open

Pre-transform error: fetch failed #574

productdevbook opened this issue Mar 19, 2025 · 5 comments · May be fixed by unjs/fontaine#499

Comments

@productdevbook
Copy link
Member

Nuxt 3.16.1

[8:47:30 PM]  ERROR  Pre-transform error: fetch failed
  Plugin: nuxt:fonts:font-family-injection
  File: /country/app/assets/css/tailwind.css
  fonts: {
    families: [
      { name: 'Inter', provider: 'google' },
      { name: 'JetBrains Mono', provider: 'google' },
      { name: 'IM Fell English', provider: 'google' },
      { name: 'Pirata One', provider: 'google' },
      {
        name: 'Fira Code',
        provider: 'google',
        weights: [400, 500],
      },
    ],
  },
@qwerzl qwerzl marked this as a duplicate of #577 Mar 21, 2025
@qwerzl
Copy link
Member

qwerzl commented Mar 21, 2025

Is this happening randomly? I'm not able to reproduce it. If it's not a random behavior please add a reproduction.

@productdevbook
Copy link
Member Author

Yes, it's random. I couldn't reproduce it. Today, for example, it works.

@JeremyMees
Copy link

JeremyMees commented Mar 21, 2025

It seems like i got a similar problem when building my website with Vercel (Node 20). I added Nuxtjs/fonts (0.11.0) to my existing Nuxt (3.15.4) project and since then i got build fails. It doesn't seem random for me though. I tried redeploying six times and it failed every time sadly enough.

~ Vercel build logs

[info] Building client...
[info] vite v6.1.0 building for production...
[info] transforming...
[info] ✓ 355 modules transformed.
[error] x Build failed in 6.03s
[error] [nuxi] Nuxt Build Error: [nuxt:fonts:font-family-injection] fetch failed
file: /vercel/path0/assets/css/tailwind.css
  at node:internal/deps/undici/undici:13502:13
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async fromUrl (node_modules/@capsizecss/unpack/dist/index.mjs:281:20)
  at async readMetrics (node_modules/fontaine/dist/index.mjs:120:82)
  at async generateFontFallbacks (node_modules/@nuxt/fonts/dist/module.mjs:44:67)
  at async addFontFaceDeclaration (node_modules/@nuxt/fonts/dist/module.mjs:380:38)
  at async Promise.all (index 14)
  at async transformCSS (node_modules/@nuxt/fonts/dist/module.mjs:449:5)
  at async Object.transform (node_modules/@nuxt/fonts/dist/module.mjs:461:17)
  at async transform (node_modules/rollup/dist/es/shared/node-entry.js:20698:16)
  [cause]: 
    at internalConnectMultiple (node:net:1122:18)
    at internalConnectMultiple (node:net:1190:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1716:5)

~ tailwind.config.ts

{
  theme: {
      ...
    },
    extend: {
      fontFamily: {
        title: ['Geist'],
        text: ['Geist Mono']
      }
  }
}

@wasitum
Copy link

wasitum commented Mar 26, 2025

I can report a similar symptom here, it is indeed random, I relaunched the script and it worked at the 5th attemps

Image

@ZTL-UwU
Copy link

ZTL-UwU commented Mar 27, 2025

For me it's happening 100% today on vercel and GitHub ci but 0% locally.

@ZTL-UwU ZTL-UwU linked a pull request Apr 3, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants