v-bind with null on slot will crash the app
Vue version
v3.3.0-alpha.4
Link to minimal reproduction
Steps to reproduce
Wait page loading, then we will see an error: Cannot read properties of null (reading 'key')
What is expected?
Do not crash, and point out v-bind
should working with an object.
What is actually happening?
Crashed
System Info
No response
Any additional comments?
No response
I think it is illegal to pass a null to v-bind, but in order to avoid this kind of error, I think it is still necessary to deal with fixing it. cc @LinusBorg
FYI, It's also crash when pass a non-object value. For example, v-bind="1"
and v-bind="'aaa'"
. playground
I think it'd make sense to have a dev warning at runtime if the value passed to v-bind
isn't an object.
Just to add to this, and maybe it's my misunderstanding of how v-bind works internally, but this example works for an input if I v-bind a null ref (check Comp.vue
for implementation). However, if I use it on the commented out slot, I get an error.