harlan-zw / nuxt-seo

The complete SEO solution for Nuxt.
https://nuxtseo.com
1.02k stars 63 forks source link

`app` type changes to any once this module is added to a Nuxt 3 application. #181

Closed BayBreezy closed 1 week ago

BayBreezy commented 7 months ago

Describe the bug

Thanks for the module, it is a real time saver.

I did realize that once I add this module to my nuxt 3 project, the type for app changes to any. So if I try to get "type help" in vscode bt pressing "Ctrl+Spacebar' nothing shows up. Once I uninstall thsi module, the types for the app property in my nuxt config comes back.

This is the app config that I am referring to: https://nuxt.com/docs/api/nuxt-config#app

Reproduction

No response

System / Nuxt Info

------------------------------
- Operating System: Windows_NT
- Node Version:     v18.18.1
- Nuxt Version:     3.10.1
- CLI Version:      3.10.0
- Nitro Version:    2.8.1
- Package Manager:  npm@9.8.1
- Builder:          -
- User Config:      devtools, modules, imports, icon, googleFonts, app, build
- Runtime Modules:  nuxt-icon-tw@0.1.3, @nuxtjs/tailwindcss@6.11.3, @vueuse/nuxt@10.7.2, @nuxtjs/google-fonts@3.1.3, @vee-validate/nuxt@4.12.5    
- Build Modules:    -
------------------------------
harlan-zw commented 2 months ago

I believe this should be fixed in the latest RC.

KazariEX commented 1 month ago

Unfortunately, I found that this issue remains unresolved. @nuxt/schema does not export ConfigSchema, and it internally uses DeepPartial to declare the app property. This current approach of extending the interface results in incorrect type hints. Should we consider other methods?