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.

googleFonts does not exist in type 'NuxtConfig'

See original GitHub issue

package.json "@nuxtjs/google-fonts": "^3.0.0-1",

nuxt.config.ts modules: ["@nuxtjs/google-fonts"],

googleFonts: {
    display: 'swap',
    useStylesheet: true,
    inject: true,
    download: true,
    families: {
        'Inter': [300, 400, 500, 600, 700],
        'Open Sans': [300, 400, 500, 600, 700]
    }

error: Object literal may only specify known properties, and ‘googleFonts’ does not exist in type 'NuxtConfig

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:5
  • Comments:8

github_iconTop GitHub Comments

5reactions
eli-mecommented, Nov 12, 2022

After reading the issues a little bit I could find the reason of the problem with Nuxt3, it’s because you have to install the pre-release version of this package, see below:

For Nuxt 3 you need to install version 3 of this module (prerelease tag) and it will work
npm install --save-dev @nuxtjs/google-fonts@prerelease

_Originally posted by @iamandrewluca in https://github.com/nuxt-community/google-fonts-module/issues/107#issuecomment-1300924762_

2reactions
SPH73commented, Nov 17, 2022

Even with the prerelease tag, Nuxt can’t spin up the dev server.

Cannot restart nuxt: Cannot find module '/.../webapp/node_modules/@nuxtjs/google-fonts/dist/module.js'. Please verify that the package.json has a valid "main" entry

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nuxtjs/tailwindcss', "@nuxtjs/google-fonts"],
}
package.json
"devDependencies": {
    "@nuxtjs/google-fonts": "^3.0.0-1",
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Google font import not working with NuxtJS component style
Running Nuxt locally works, but once deployed quite a few things seem to not work as intended. My question in this instance is...
Read more >
Options - nuxtjs/google-fonts
The font-display property lets you control what happens while the font is still loading or otherwise unavailable. Type: String Default: 'swap'.
Read more >
Adding Google Fonts to your NuxtJS site - Elian Codes
Adding fonts to your NuxtJS configuration is very easy. You just have to add them in the nuxt.config.js file. There's a lot of...
Read more >
How can I properly integrate Google Fonts into Nuxt.js?
There are two proper ways to integrate Google Fonts or any other font library into Nuxt.js. The Quick way. Copy the Embed Link...
Read more >
@nuxtjs/google-fonts - npm
Google Fonts module for Nuxt. Latest version: 2.0.0, last published: 5 months ago. Start using @nuxtjs/google-fonts in your project by ...
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