defineProps: bad type generated
Version
3.2.0-beta.1
Reproduction link
Steps to reproduce
In script-setup, defineProps
a property of type ((x: any) => boolean) | null
.
The repro above fails to execute, look at the Comp.vue
JS tab for insight.
What is expected?
It works!
What is actually happening?
As can be seen in repro, SFC compiler generates type: [null, null]
instead of type: [Function, Object]
.
Then at runtime, Vue crashes in assertType
because it tries to do value instanceof type
with type = null
.