Skip to content
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

Fonts sometimes missing in production build #356

Open
cernymatej opened this issue Oct 23, 2024 · 3 comments
Open

Fonts sometimes missing in production build #356

cernymatej opened this issue Oct 23, 2024 · 3 comments

Comments

@cernymatej
Copy link

I've been having an issue with this module, where the fetching of font files sometimes fails during the production build. I haven't been able to create a reliable reproduction yet—it seems to happen at random.

The build is done in GitHub CI, where a Docker image is built, using Node version 18.

This is the error log from the problematic deployment:

#25 20.31 [@nuxt/fonts]  ERROR  Could not fetch metadata for Red Hat Display from google. fetch failed
#25 20.31 
#25 20.31   at Object.fetch (node:internal/deps/undici/undici:11372:11)
#25 20.31   at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
#25 20.31   at async getFontDetails$5 (/opt/project/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_@[email protected]_sa_d6a46d5cxhijk7lxvuwfjdzkcm/node_modules/@nuxt/fonts/dist/module.mjs:550:12)
#25 20.31   at async cachedData (/opt/project/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_@[email protected]_sa_d6a46d5cxhijk7lxvuwfjdzkcm/node_modules/@nuxt/fonts/dist/module.mjs:474:20)
#25 20.31   at async Object.resolveFontFaces (/opt/project/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_@[email protected]_sa_d6a46d5cxhijk7lxvuwfjdzkcm/node_modules/@nuxt/fonts/dist/module.mjs:511:14)
#25 20.31   at async resolveFontFaceWithOverride (/opt/project/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_@[email protected]_sa_d6a46d5cxhijk7lxvuwfjdzkcm/node_modules/@nuxt/fonts/dist/module.mjs:1395:26)
#25 20.31   at async addFontFaceDeclaration (/opt/project/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_@[email protected]_sa_d6a46d5cxhijk7lxvuwfjdzkcm/node_modules/@nuxt/fonts/dist/module.mjs:940:22)
#25 20.31   at async Promise.all (index 0)
#25 20.31   at async transformCSS (/opt/project/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_@[email protected]_sa_d6a46d5cxhijk7lxvuwfjdzkcm/node_modules/@nuxt/fonts/dist/module.mjs:1013:5)
#25 20.31   at async Object.transform (/opt/project/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_@[email protected]_sa_d6a46d5cxhijk7lxvuwfjdzkcm/node_modules/@nuxt/fonts/dist/module.mjs:1025:17)
#25 20.31 
#25 20.31 
#25 20.31 [@nuxt/fonts]  WARN  Could not produce font face declaration from google for font family Red Hat Display.
#25 20.31 
#25 42.48 ℹ ✓ 1387 modules transformed.

Has anyone else come across this issue? Wouldn't it be better to exit rather than continue with the build if the font fetch fails?

@danielroe
Copy link
Member

danielroe commented Oct 24, 2024

yes, it might be worth retrying the fetch a couple of times, and if not - failing the build ...

we can implement in https://github.com/unjs/unifont.

@qwerzl
Copy link
Member

qwerzl commented Dec 5, 2024

Unifont has added support for retries. @danielroe I think we should create a new release with the new unifont.

@danielroe
Copy link
Member

✅ Done - latest release should pull in the latest unifont changes.

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

No branches or pull requests

3 participants