vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
47.59k stars 8.32k forks source link

"Component is null" error occurs when updating props in a deferred teleport during component creation. #12161

Open lelmestour opened 3 weeks ago

lelmestour commented 3 weeks ago

Vue version

3.5.12

Link to minimal reproduction

https://play.vuejs.org/#eNqVVN9v0zAQ/leO8JBOWhOxwUvppg1UBDzAtO0NI5Qll9Vragf7km2q+r9ztpO0ldpKPCW+++7Xd5+9iq7rOmkbjCbR1OZG1gQWqakvhZLLWhuCFRgsYQ2l0UuIGRoPrs96WXf2JHUHlyn+KJRQuVaWoMASjcECLlySUZlVFk+ce5qGYlyGD4TLusoI+QQwfWiItIKrvJL54kJEW0nINCiiy9wgo+FMFSC5TKZynKYhLKQoZAuy4Ng5ZgUayzGuEHtSdg0Y/8O/b8bj+7m0oBXCszYLOx73LjdVug9XaLQqpl0ktGNZbrUsohDbl52mw6jRaUSWWSrlY/JkteIFrBxURDknkhWanzVJZlFEE/Ae58uqSj9/9zbHxWlvz+eYL/bYn+yLs4noxqBF0zJ7g48y84gU3LO7H/jC/4NzqYumYvQR5y1aXTWuxwD71KiC297C+W6/ea1I9XhvZy+EyvZD+WUycu3xImLtOA4Pjb5p9zx57+OEWjOLve7+R8Es0c73RWtCM4g4HHsZd5ivXkQDJhw3Uk9TIKcKV8TOdVMV8IDQ1AWvuQDSEOtFDA+vjMKuXmwBW1TU35NMvd5ydLglsdIEHHLis5eNyh0ZLLprNXNBozarGjwJzITIxJs43n85jrk5fsnusUI/nJcqd8mqfbt9W7ymu8knXOXG6Joxod5G132ecOzYvMrU2M/HAUPbIWb3Bmzo3rO9QA0uJfFg3KZUOOODHf2Ks5Ay/h04cpjRYDz1hDvPEQJC5Z1+hOKONss92FHNTNihJceLHfEuBL9DniWvWUGC6LXGCdyRYfGzxp3J4N9G8sPQq1+QUzE/iQdbFdQtYbRadQXWIWC38T8tb451wm2fJx+Sd2fR+h8Bzf9K

Steps to reproduce

Click on the button to create an instance of the component and trigger the error.

What is expected?

The second Comp instance should be created without causing any errors, like the first one.

What is actually happening?

A 'component is null' TypeError is thrown when the component is not instantiated during the App creation.

System Info

No response

Any additional comments?

No response

edison1105 commented 3 weeks ago

a workaround

onMounted(() => {
  emit('anEvent', 'ok');
})