question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

node_modules/.cache/nuxt-google-fonts needs to be deleted on font-family addition/removal

See original GitHub issue

The issue: When updating the font families in nuxt.config.ts after an initial load, the node_modules/.cache/nuxt-google-fonts directory doesn’t update the css or files contents to match the settings.

How to recreate: Follow the documentation for installing w/ nuxt3 and select an initial font-family (i.e. Roboto). Add additional families and/or remove the initial family. Update styling to use new families and restart server. If initial family removed, previous styling will break. New families will not be included. Navigate to node_modules/.cache/nuxt-google-fonts/ and view that /css and /fonts files only represent the initial settings.

Work around: Delete the node_modules/.cache/nuxt-google-fonts directory and restart the nuxt3 server. The module will populate the cache with the updated settings.

Supporting information: versions

"devDependencies": {
  "nuxt": "3.0.0-rc.9",
},
"dependencies": {
  "@nuxtjs/google-fonts": "^3.0.0-0"
}

nuxt.config.ts

export default defineNuxtConfig({
  srcDir: "./src",
  modules: ["nuxt-icon", "@nuxtjs/google-fonts"],
  googleFonts: {
    download: true,
    subsets: "latin",
    families: {
      Roboto: [300, 400, 500, 700],
      Ubuntu: [400, 500, 700],
    },
  },
});

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ricardogobbosouzacommented, Oct 14, 2022

Fixed in next release https://github.com/nuxt-community/google-fonts-module/pull/105

  • The overwriting option will be detected automatically
0reactions
ricardogobbosouzacommented, Oct 27, 2022

If the problem persists, please reopen

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using web fonts – Fonts Knowledge - Google Fonts
First we'll need to load the font files; then, we need to reference those files and assign weights and styles (although these first...
Read more >
Custom font not working in React Native - Stack Overflow
Unsure why you need to delete node_modules in this command. The command should simply be 'react-native link'. – Lee Brindley. Feb 3, 2018...
Read more >
Frequently Asked Questions | Google Fonts
Remove all the current font files for that family from your device, reboot, and then download and install the latest font files. Where...
Read more >
Theme.json typography options: Font family and size
Learn about the theme.json typography options for font family and font size and how to add custom google fonts with the webfonts API....
Read more >
Self-hosted Google Fonts – Uncode Theme
If you don't need them please remove from the Uncode Fonts importer, screenshot. Facebook · Twitter · LinkedIn. Was this article helpful?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found