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.

Cannot read 'resolveAlias' when using with Nuxt 3

See original GitHub issue

I want to add google-fonts to my Nuxt 3 project and follow the docs.

I added a font like this

googleFonts: {
    download: true,
    display: 'swap',
    families: {
        Montserrat: {
            wght: [400,500,600],
            ital: [400,500,600]
        },
    }
}

But when I try to run the project in dev mode I get an error

Cannot start nuxt: Cannot read properties of undefined (reading ‘resolveAlias’) at node_modules@nuxtjs\google-fonts\dist\module.js:59:44

and this is what the line looks like

const outputDir = this.nuxt.resolver.resolveAlias(options.outputDir);

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

18reactions
lightcode22commented, Nov 2, 2022

could you please put this information somewhere on the module website or github page? It will save someone’s time and nerves one day

10reactions
iamandrewlucacommented, Nov 2, 2022

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt 3 issue "Cannot read property 'resolveAlias' of undefined"
ERROR Cannot restart nuxt: Cannot read property 'resolveAlias' of undefined at Object.
Read more >
Introduction to Nuxt 3 modules - DEV Community ‍ ‍
For Nuxt 3, recommended docs approach is to use a new tool called Docus. ... I only get Unresolved variable $strapi / Cannot...
Read more >
vue nuxt TypeError: Cannot read properties of undefined ...
I'm trying to make auth using keycloak ...
Read more >
The alias Property - Nuxt
The alias property. Nuxt allows you to use aliases to access custom directories within your JavaScript and CSS. Type: Object; Default:.
Read more >
How to use Vuetify with Nuxt 3 - Cody Bontecou
While you are in the nuxt application's root directory, run the following command to install Vuetify 3 and it's dependency, sass. bash yarn...
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