nuxt / icon

The <Icon> component, supporting Iconify, Emojis and custom components.
https://stackblitz.com/edit/nuxt-icon-playground?file=app.vue
MIT License
874 stars 38 forks source link

Error something on nuxt 3.1.0 - ERROR(vue-tsc) Property 'nuxtIcon' does not exist on type 'AppConfig'. #46

Closed chanthavong closed 1 year ago

chanthavong commented 1 year ago

error message

ERROR(vue-tsc) Property 'nuxtIcon' does not exist on type 'AppConfig'. const props = defineProps({ name: { type: String as PropType<keyof AppConfig['nuxtIcon']['aliases'] | (string & {})>, ^^^^^^^^^^ required: true },

code


export default defineNuxtConfig({
  srcDir: 'src',
  ssr: false,
  typescript: {
    typeCheck: true
  },
  modules: ['@nuxtjs/tailwindcss', 'nuxt-icon']

})
Tahul commented 1 year ago

Should be fixed by ^0.2.10 ; could you try it? :)

thorau commented 1 year ago

Error is still occuring on nuxt 3.1.1:

ERROR(vue-tsc)  Property 'nuxtIcon' does not exist on type 'AppConfig'.
 FILE /node_modules/.pnpm/nuxt-icon@0.2.10/node_modules/nuxt-icon/dist/runtime/Icon.vue:34:40

    32 | const component = computed(() => nuxtApp.vueApp.component(iconName.value))
    33 | const sSize = computed(() => {
  > 34 |   const size = props.size || appConfig.nuxtIcon?.size || '1em'
       |                                        ^^^^^^^^
    35 |   if (String(Number(size)) === size) {
    36 |     return `${size}px`
    37 |   }