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 TS2339: Property 'nuxtIcon' does not exist on type 'AppConfig'. #50

Closed hermesalvesbr closed 1 year ago

hermesalvesbr commented 1 year ago

The same of, but with newer version: Error something on nuxt 3.1.0 - ERROR(vue-tsc) Property 'nuxtIcon' does not exist on type 'AppConfig'. #46

Captura de tela de 2023-02-06 16-21-23 node_modules/.pnpm/nuxt-icon@0.2.10/node_modules/nuxt-icon/dist/runtime/Icon.vue:34:40

My all packages:

dependencies:
@nuxtjs/robots 3.0.0       apexcharts 3.37.0          moment 2.29.4              swiper 9.0.3               vue3-apexcharts 1.4.1      
@nuxtjs/tailwindcss 6.3.1  axios 1.3.2                nuxt-directus 3.2.2        type-check 0.4.0           yarn-upgrade-all 0.7.2     
@vueuse/core 9.12.0        daisyui 2.50.0             sanitize-html 2.9.0        vue-instantsearch 4.8.2    

devDependencies:
@commitlint/cli 17.4.2                   @typescript-eslint/parser 5.51.0         eslint-plugin-prettier 4.2.1             nuxt-icon 0.2.10                         
@commitlint/config-conventional 17.4.2   @vue/eslint-config-standard 8.0.1        eslint-plugin-vue 9.9.0                  nuxt-meilisearch 0.1.7                   
@types/cypress 1.1.3                     eslint 8.33.0                            husky 8.0.3                              prettier 2.8.3                           
@types/sanitize-html 2.8.0               eslint-config-prettier 8.6.0             lint-staged 13.1.0                       typescript 4.9.5                         
@typescript-eslint/eslint-plugin 5.51.0  eslint-plugin-nuxt 4.0.0                 nuxt 3.1.2                               vue-tsc 1.0.24  
albericobenhur commented 1 year ago

I have the same isue

Tahul commented 1 year ago

Hello @albericobenhur & @hermesalvesbr ;

I made another publish of the lib, the line you mentioned seem outdated: https://github.com/nuxt-modules/icon/blob/e040a2c2f2f5cc9b813b706f4600c6979ae03ea5/src/runtime/Icon.vue#L13

The first ?. should avoid vue-tsc to throw on this one.

Could you keep me updated if this 0.2.11 version fixes it?

hermesalvesbr commented 1 year ago

Thanks for your attention, but didn't work with 0.2.11 Captura de tela de 2023-02-07 11-12-38

dependencies:
@nuxtjs/robots 3.0.0       apexcharts 3.37.0          moment 2.29.4              swiper 9.0.3               vue3-apexcharts 1.4.1      
@nuxtjs/tailwindcss 6.3.1  axios 1.3.2                nuxt-directus 3.2.2        type-check 0.4.0           yarn-upgrade-all 0.7.2     
@vueuse/core 9.12.0        daisyui 2.50.0             sanitize-html 2.9.0        vue-instantsearch 4.8.2    

devDependencies:
@commitlint/cli 17.4.2                   eslint 8.33.0                            nuxt 3.1.2                               
@commitlint/config-conventional 17.4.2   eslint-config-prettier 8.6.0             nuxt-icon 0.2.11                         
@types/cypress 1.1.3                     eslint-plugin-nuxt 4.0.0                 nuxt-meilisearch 0.1.7                   
@types/sanitize-html 2.8.0               eslint-plugin-prettier 4.2.1             prettier 2.8.3                           
@typescript-eslint/eslint-plugin 5.51.0  eslint-plugin-vue 9.9.0                  typescript 4.9.5                         
@typescript-eslint/parser 5.51.0         husky 8.0.3                              vue-tsc 1.0.24                           
@vue/eslint-config-standard 8.0.1        lint-staged 13.1.0                    
Tahul commented 1 year ago

Is this project a public repository?

I double-checked again, and I don't understand why wouldn't you have the first ?., the built output has this:

CleanShot 2023-02-07 at 16 11 22@2x

I would love to browse a sandbox/repo reproduction.

hermesalvesbr commented 1 year ago

No, it's not public, but I will make a sample and send here.

hermesalvesbr commented 1 year ago

I made a clean project and works fine. It's not a module bug.

Maybe some cache by some package.

MartCube commented 1 year ago

Hi @hermesalvesbr, would you like to share how you clean your project to avoid this problem ?

frasza commented 1 year ago

Same error for me using Node 16.18 and Nuxt 3.3

Atinux commented 1 year ago

Happy to provide a small reproduction and a new issue please @frasza 🙏 ?

frasza commented 1 year ago

@Atinux Sure, done -- https://github.com/nuxt-modules/icon/issues/62. Let me know if I can assist further.