Vue: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. #2643
Replies: 3 comments 4 replies
-
Have run into this same issue. I don't think there's another way unfortunately. But I think defining the type (although adding a small amount of work) helps the TS language server out. |
Beta Was this translation helpful? Give feedback.
-
also happening to me, any solution? |
Beta Was this translation helpful? Give feedback.
-
Is there a way for you to provide a real reproduction please? In general, Vue works better with TS when using Composition API (instead of Options API) so that's something you can try since Pinia stores can also be declared using Composition API: https://pinia.vuejs.org/core-concepts#Setup-Stores I remember dealing with a similar situation where a Options API Vue component needed explicit type annotation to work correctly. Migrating the component to Composition API "fixed" this as the compiler was able to infer the type on his own. |
Beta Was this translation helpful? Give feedback.
-
I am running into this error on a brand new project in vue3.
"typescript": "~5.4.0",
"pinia": "^2.1.7",
"vue": "^3.4.21"
And I am getting this error from Typescript:
Vue: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
I only manage to get rid of it defining a State type, is there another way ?
Beta Was this translation helpful? Give feedback.
All reactions