nuxt-community / fontawesome-module

Module to use Font Awesome icons in Nuxt.js
MIT License
110 stars 12 forks source link

Cannot read property 'prefix' of undefined #34

Open anandbhaskaran opened 3 years ago

anandbhaskaran commented 3 years ago

I tried to followed all the step as mentioned here: https://www.npmjs.com/package/@nuxtjs/fontawesome

My nuxt.config.js

buildModules: [
    // https://go.nuxtjs.dev/typescript
    '@nuxt/typescript-build',
    ['@nuxtjs/fontawesome',{
      component: 'fa',
      suffix: true,
    },],
  ],
fontawesome: {
    icons: {
      solid: ['faHome'],
      regular: ['faUserSecret'],
      brands: ['faGithub'],
    }
  },

My usage of the component

<fa :icon="['fab', 'github']"/>

Expected outcome: Works out of the box

Actual Outcome: App crashes with the following error on the console image

dargmuesli commented 3 years ago

The regular version of faUserSecret requires Pro, doesn't it? The error message could be more helpful though.

nicolas-giuristante commented 3 years ago

I have the exact same issue. Been troubleshooting for hours without success.

Using the not recommended regular: true does not trigger the error but does not load anything in the free solid, nor free regular sets of icons. For some reason I was able to load something (Instagram) in the brand set. But after so many attempts, I was not able to load it again... I finally ended up loading the set through CDN.

TiddlyWin commented 2 years ago

I wouldn't say this was an issue, I think you've used the incorrect element tag.It would error for me if I used 'fa'. As @dargmuesli said, the error could be more informative.

Try the below

Screenshot 2021-11-02 at 11 00 32 Screenshot 2021-11-02 at 10 56 45 Screenshot 2021-11-02 at 10 59 44 Screenshot 2021-11-02 at 11 00 07