vue-tsc: Fails to infer types for some components in v3.2.0 and later #5917
-
|
After updating vue-tsc to v3.2.0 or later, type inference has started failing within the template of a specific component, causing every objects (both externally imported objects and those defined within the I created a minimal reproduction that extracts the core characteristics of the component. However, they are functioning without issue:
Since minimal reproduction is working (or I just poorly tested), I will also document issues with real-world components. This issue occurs in the I found that type inference in
Given that this component is large, I assume that type tracking became impossible and it fell back to Corresponding Issues / PRs |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
You can install the VS Code extension Volar Labs, paste the virtual code of that sfc into a temporary .ts file next to it and check for type issues. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @KazariEX, thank you for addressing my question! It helps me a lot. I found out that type inference using Is this a bug in vue-tsc, or is it by design? Or perhaps it's because my code doesn't follow best practices? |
Beta Was this translation helpful? Give feedback.
It's likely a circular reference issue caused by the type inference of template refs.