Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'nuxtIcon' is missing in type 'AppConfig' when update to 2.11.0 #1045

Closed
tidusvn05 opened this issue Nov 30, 2023 · 8 comments · Fixed by #1789
Closed

Property 'nuxtIcon' is missing in type 'AppConfig' when update to 2.11.0 #1045

tidusvn05 opened this issue Nov 30, 2023 · 8 comments · Fixed by #1789
Labels
bug Something isn't working

Comments

@tidusvn05
Copy link

Environment


  • Operating System: Darwin
  • Node Version: v18.17.1
  • Nuxt Version: 3.8.2
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: ssr, devtools, modules, ui, colorMode, runtimeConfig, supabase, imports, nitro, typescript
  • Runtime Modules: @pinia/[email protected], @nuxt/[email protected], @nuxtjs/[email protected]
  • Build Modules: -

Version

2.11.0

Reproduction

https://stackblitz.com/edit/nuxt-ui

Description

[email protected][email protected][email protected][email protected]/node_modules/nuxt-icon/dist/runtime/Icon.vue:11:19

ERROR(vue-tsc) Conversion of type 'AppConfig' to type '{ nuxtIcon: { size?: string; class?: string; aliases?: Record<string, string>; iconifyApiOptions?: { url?: string; publicApiFallback?: boolean; }; }; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Property 'nuxtIcon' is missing in type 'AppConfig' but required in type '{ nuxtIcon: { size?: string; class?: string; aliases?: Record<string, string>; iconifyApiOptions?: { url?: string; publicApiFallback?: boolean; }; }; }'.

Screenshot 2023-11-30 at 09 37 35

Additional context

No response

Logs

No response

@tidusvn05 tidusvn05 added the bug Something isn't working label Nov 30, 2023
@tidusvn05
Copy link
Author

a trick during waiting a fix from nuxt-icon

  • app.config.ts
// fix type-checkin error
  nuxtIcon: {},

@ymansurozer
Copy link

Same here. And this did not work for me:

// fix type-checkin error
nuxtIcon: {},

@4F2E4A2E
Copy link

4F2E4A2E commented Jan 22, 2024

a trick during waiting a fix from nuxt-icon

  • app.config.ts
// fix type-checkin error
  nuxtIcon: {},

did not work for me either

"devDependencies": {
    "@nuxt/devtools": "1.0.8",
    "nuxt": "3.9.3",
    "typescript": "^5.3.3",
    "vue": "3.4.15",
    "vue-router": "4.2.5",
    "vue-tsc": "^1.8.27"
  },
  "dependencies": {
    "@formkit/nuxt": "1.5.1",
    "@nuxt/ui": "2.12.3",
  }

@charlesfaustin
Copy link

charlesfaustin commented Jan 24, 2024

a trick during waiting a fix from nuxt-icon

  • app.config.ts
// fix type-checkin error
  nuxtIcon: {},

did not work for me either

"devDependencies": {
    "@nuxt/devtools": "1.0.8",
    "nuxt": "3.9.3",
    "typescript": "^5.3.3",
    "vue": "3.4.15",
    "vue-router": "4.2.5",
    "vue-tsc": "^1.8.27"
  },
  "dependencies": {
    "@formkit/nuxt": "1.5.1",
    "@nuxt/ui": "2.12.3",
  }

does this work nuxt/icon#117 (comment)

export default defineAppConfig({ nuxtIcon: {}, })

Copy link
Collaborator

Sorry for the late reply, is this still an issue with the latest @nuxt/ui versions?

@chris-pinola-rf
Copy link

chris-pinola-rf commented Apr 8, 2024

@sandros94 yes, it's still happening for me on the latest version of @nuxt/ui (2.15.1):

  "dependencies": {
    "@grpc/grpc-js": "^1.10.6",
    "@grpc/proto-loader": "^0.7.12",
    "@nuxt/ui": "^2.15.1",
    "date-fns": "^3.6.0",
    "nuxt": "^3.11.2",
    "v-calendar": "^3.1.2",
    "vue": "^3.4.21",
    "vue-router": "^4.3.0",
    "zod": "^3.22.4"
  },
  "devDependencies": {
    "@nuxt/eslint-config": "^0.3.0",
    "@nuxt/test-utils": "^3.12.0",
    "@vue/test-utils": "^2.4.5",
    "eslint": "^8.57.0",
    "happy-dom": "^14.5.1",
    "playwright-core": "^1.43.0",
    "typescript": "^5.4.4",
    "vitest": "^1.4.0",
    "vue-tsc": "^1.8.27"
  }

Though, as others have reported, I'm able to workaround it with an app.config.ts:

export default defineAppConfig({
    nuxtIcon: {},
})

@agentprivatbanka
Copy link

agentprivatbanka commented Apr 18, 2024

Though, as others

check if you have AppConfig in the index.d.ts file, it can overwrite the automatically generated nuxt types for app.config
SCR-20240418-huvk

@syed-haroon
Copy link

a trick during waiting a fix from nuxt-icon

  • app.config.ts
// fix type-checkin error
  nuxtIcon: {},

This Helped, here is full code for the file ./app.config.ts

export default defineAppConfig({
  nuxtIcon: {},
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants