fonts icon indicating copy to clipboard operation
fonts copied to clipboard

Adding fonts like "Quiksand" and "Urbanist" fails

Open aidedee opened this issue 1 year ago • 11 comments

Fonts like "Quiksand" and "Urbanist" failing in deployed project. But "Poppins" it adds correctly.

I was happy to easily can choose so much fonts in local development but in deployed project it fails. Hoping it will be fixed soon....

aidedee avatar Aug 30 '24 09:08 aidedee

Hey @dhillweb! I'm here to help you with any bugs, questions, or contributions you have while waiting for a human maintainer. Let's tackle this font issue together!

The issue with "Quiksand" and "Urbanist" fonts failing to load in the deployed project while "Poppins" works correctly could be due to the way Nuxt Fonts processes and resolves fonts. Nuxt Fonts uses a provider called fontsource to fetch font metadata and details. If "Quiksand" and "Urbanist" are not recognized by the fontsource provider, they will fail to load. This could happen if these fonts are not available in the fontsource metadata or if there is an error fetching their details.

To resolve this issue, ensure that "Quiksand" and "Urbanist" are supported by the fontsource provider. You can verify this by checking the fontsource metadata or by explicitly configuring these fonts in your Nuxt configuration. Additionally, you can handle errors more gracefully by logging them and providing fallback options if the fonts are not available [1][2].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Aug 30 '24 09:08 dosubot[bot]

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a template for starting with a minimal reproduction:

👉 https://stackblitz.com/github/nuxt/fonts/tree/main/example

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

github-actions[bot] avatar Aug 30 '24 09:08 github-actions[bot]

FWIW it has been suggested to just add the CSS manually

davestewart avatar Sep 02 '24 16:09 davestewart

I do not need modules?

ghost avatar Sep 02 '24 17:09 ghost

You can just add the CSS and links in the head section of Nuxt's config:

  • https://nuxt.com/docs/api/nuxt-config#head

davestewart avatar Sep 02 '24 18:09 davestewart

I know about. But thank you very much for your notion. It works fine.

ghost avatar Sep 08 '24 08:09 ghost

Would you be able to provide a reproduction? 🙏

More info

https://stackblitz.com/edit/nuxt-starter-71tsjv?embed=1&file=README.md

ghost avatar Oct 11 '24 00:10 ghost

Would you be able to provide a reproduction? 🙏 More info

https://stackblitz.com/edit/nuxt-starter-71tsjv?embed=1&file=README.md

@aidedee

I'm not able to reproduce on my side. Would you provide more details?

Image

qwerzl avatar Oct 11 '24 01:10 qwerzl

After deployment only!

ghost avatar Oct 11 '24 01:10 ghost

Image

ghost avatar Oct 11 '24 01:10 ghost

Right. On Stackblitz I've observed fetch issues caused by CORS. I'm not too familiar with Stackblitz personally, but please try this out.

qwerzl avatar Oct 11 '24 01:10 qwerzl

This seems to work fine locally, and in Stackblitz with the cors proxy that @qwerzl recommends

Image

danielroe avatar Oct 11 '24 23:10 danielroe

I was choosing to add the font without the module. I don't know how it works in deployment with this workaround.

Locally the fonts are showing up with or without the workaround.

Image

Thank you very much

;)

ghost avatar Oct 12 '24 00:10 ghost

Seems to be working fine, then, right?

I think we can close it - maybe it was an issue with an earlier version of the module.

danielroe avatar Oct 12 '24 22:10 danielroe

Yes, I think you are right.

ghost avatar Oct 13 '24 07:10 ghost