'$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
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.Thank you, @Jacek !
So I'd just search for that declare in my codebase? Because the only search hit is in '@vue/runtime-core'.
Hm... I compared with my own and I have only 2 hits (the commented ones)
I have
3.4.38
. What is your version?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 [email protected] earlier but now rolled back to 3.4.38 but I still have the @vue/[email protected] installed...
GitHub
types(defineComponent): support for GlobalComponents, typed Directi...
β¦s and respect
expose
on defineComponent (#3399)
close #3367OK
yarn why
showed that [email protected] as well as some other vue dependencies require the [email protected]... π¦Maybe
yarn add @vue/[email protected]
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.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 !