(compat) slots are undefined in functional component during first render
Version
@vue/compat 3.1.1
Reproduction link
@vue/compat@3.1.1 - https://jsfiddle.net/yc3r45jo/ (with bug) vue@3.1.1 - https://jsfiddle.net/Ln6e9yvb/
Steps to reproduce
Open @vue/compat reproduction
What is expected?
Should render button component
What is actually happening?
App crashes because button component throws error
Uncaught TypeError: Cannot read property 'default' of undefined
and it throws an error because of this line const children = slots.default?.();
for some reason in compatibility build functional component renders twice and during first render slots object is undefined. // edit: same thing happens with attrs, also undefined
Everything works fine in vue@3.1.1
I also have a side question. Why when I log props or attrs in the console it shows me the resulat as ƒ () { [native code] }
instead of just log the object? This is only the case in compatibility build.