-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PropType with Interface with all optional properties leads to unknown type #11272
Comments
as a workaround use |
FYI: This doesn't seem to be a Vue type issue, ref TypeScript playground |
This seems to only happen in the playground, maybe due to outdated Volar used? I can't reproduce this locally in VSCode either. |
That's very interesting, thank you for taking a look. With a fresh I didn't think to test this way since I was able to repro quickly in the playground. Let me see if I can do some more digging and get back to you. |
Closing as a duplicate of #11733 - neither can be reproduced on my end so let's keep only one open. |
Here's a minimal reproduction (just https://stackblitz.com/edit/stackblitz-starters-zu6gov To be clear, this issue is only reproducible with |
Vue version
3.4.31
Link to minimal reproduction
https://play.vuejs.org/#eNqNVMtu2zAQ/JUFL04A10KbnhTFQVvkkB7qIM1RQKHHyqYjkSxJOW4N/3t3KVl+pHkYBkzuLoczu0NvxBdjJqsWRSwSV1hpPDj0rYE6U/OrVHiXimmqZGO09fBNNwYqqxsYTSLe8NHRZaqGig1YrGDbF3GWk4VWzoP02MAVF5xtUgVQaR2Dty2OeZdnNoZPqdqeB7wk6ujQ5bShk6bOPNIOIOGbeQGw+pBLVcaMTGT5JxVHGe0XaG9P09MksCe0JDqAFmPSS1wrOZ8snVbUlEA0FQVVyxrtzHhJWlIRQ8hwLqtr/fQ9xAYx4cwCi8f/xJduzbFU3Fl0aFeYiiHnMztH36Vvfv7ANa2HZKPLtqbqV5L36HTdMseu7GurSqJ9UBfY3oZhSTV/cDdrj8rtRDFRrtyG+lTQALlRL0nf072YfA7naH7UxZ013nAVQO8a/8cgWefOavPAy0P/kBuGug14fX/ir+AWqlAebZUVCDztHUWy2HUMudY1ZiogsdH+Uky1TY42hIj0McJsZ5oDmPeidFY3pMSR10uspELW5TrP0zWEO7QQgvQYZvkSCw+ZG3qQ8P3TfmxAj+Z3Ky2WR17qpgQwmPw9uIO4t8CDqO4x7mT1LzgM4SxoHMOIg6PzS4iibo6VtuAX0gF9W/Wo9JO63kMMXJ/hDJkeLG97YxwCko1e/28o5SosaGlsF+NP351NJ2EbxFFJtK85Kg9N2h/ak35+Mom6K0//SX6t0PK7ojdAj2Ny8VFs/wEOa8gQ
Steps to reproduce
Comp.vue
fileitem
isunknown
otherItem
is set toOtherItem
What is expected?
The type for
item
on line 26 should be theItem
interface defined on line 5.What is actually happening?
The type for
item
is returningunknown
.System Info
Any additional comments?
It seems that whenever an Interface/type contains only optional properties, the type that's inferred is always
unknown
.The text was updated successfully, but these errors were encountered: