therufa / mdi-vue

Material design icons for vue.js
https://www.npmjs.com/package/mdi-vue
MIT License
88 stars 13 forks source link

Error Nuxt in SSR mode #64

Closed Sendoo closed 3 years ago

Sendoo commented 3 years ago

Versions

Problem

Hi✌

If you run the plugin with the following code:

import Vue from 'vue';
import mdiVue from 'mdi-vue/v2'
import * as mdijs from '@mdi/js'

Vue.use(mdiVue, {
  icons: mdijs
}) 

Then we get this error:

изображение

If you run the plugin in client mode, then there is no error. But there is a big delay in displaying icons.

Sendoo commented 3 years ago

It seems that it turned out to run 🙂 When using Nuxt.js, mdi-vue should be added to the transpile build option in nuxt.config.js:

export default {
  // ...
  build: {
    transpile: ['mdi-vue']
  }
}

Maybe you should add this to your plugin documentation?

therufa commented 3 years ago

Thanks for the addition @Sendoo, fair point :)