N
Nuxtβ€’3w ago
luhu

'$auth' is of type 'unknown'.ts (18046)

After upgrading to latest nuxt (3.13.0), typescript (5.5.4) and all dependencies (newly created lock file) I get an error for all custom nuxt plugins I have created, e.g. '$auth' is of type 'unknown'.ts (18046). It worked fine in the version before. I figured it would be a problem with typescript 5.5.4 in combination with eslint and nuxt, but as far as I see nuxt is using the very same typescript version right now. Any ideas on what I can do or how I can debug this?
7 Replies
Jacek
Jacekβ€’3w ago
It seems that TS refuses to cooperate when there is any code with old declare module '@vue/runtime-core' instead of new declare module 'vue'. Some dependencies might not be updated yet. See #28542 and related links for more information. I had my of piece of *.d.ts with it, so even on the newest dependencies VSCode was still underlining every global property.
luhu
luhuβ€’3w ago
Thank you, @Jacek ! So I'd just search for that declare in my codebase? Because the only search hit is in '@vue/runtime-core'.
No description
Jacek
Jacekβ€’3w ago
Hm... I compared with my own and I have only 2 hits (the commented ones) I have 3.4.38. What is your version?
luhu
luhuβ€’3w ago
I have the latest 3.5.0. Seems like this change has introduced the declare: https://github.com/vuejs/core/commit/4cc9ca870c37b35d0600d3a6838baf935be5b7c2 Unfortunately I don't get why the 3.5.0 is there at all. I installed vue@3.5.0 earlier but now rolled back to 3.4.38 but I still have the @vue/runtime-core@3.5.0 installed...
GitHub
types(defineComponent): support for GlobalComponents, typed Directi...
…s and respect expose on defineComponent (#3399) close #3367
luhu
luhuβ€’3w ago
OK yarn why showed that nuxt@3.13.0 as well as some other vue dependencies require the vue@3.5.0... 😦
Jacek
Jacekβ€’3w ago
Maybe yarn add @vue/runtime-core@3.4.38 could force the downgrade? I am hesitant to upgrade my codebase to 3.5.0 and find out if it breaks everything πŸ˜… You can remove the declaration manually within node_modules and restart Vue and TS server to verify if we look at the suspect.
luhu
luhuβ€’3w ago
Hm, this won't help as well unfortunately. I guess I'll just wait a few weeks until all dependencies have adopted this change... 😦 Thanks for your help, @Jacek !
Want results from more Discord servers?
Add your server