-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
When calling a function in a template to create a VNode, an error occurs when updating the component: Cannot read properties of null (reading 'emitsOptions') #13077
Comments
|
Thanks for your explanation. I know that passing the component to the |
If you are sure that passing VNode to the |
It is OK to create in the same block. see: playground |
duplicate of #6913 function createNode() {
setBlockTracking(-1)
const node = h(Hello)
setBlockTracking(1)
return node
} see playground |
Vue version
v3.5.13
Link to minimal reproduction
https://play.vuejs.org/#eNp9U8tu2zAQ/JUFL3KQQCrQnlzZaBsEaHtIg7a3sgdHWtlMJJLgwzEg6N+zS9mKggQ+SBB3ZoezD/Xiq7X5PqJYitJXTtkAHkO0a6lVZ40L0MMOBmic6SAjYvZ5hjhsXmETdGtqPMbzgg98B8FSV0b7AJWJOqCDFUssPly8IN+xbQ3FFxewWkMvNRAlRKchSxCJDMxuoq6CMhoqh5uAfAelzPm7RUogbUooi7E6qosOATvbUhadAK5bVT1C2CFEW1MQ7mMIJBwM7BU+JYS9mRYBnTMOlG6M6zZ8fQ7lvSuSDj/lMfdLxaIrKY6FXl5KsR7ll9D3U/3DUBZjSjLGAg5YLn2nLi41vVlpVqcUiVQWs0LElQiefDZqmz94o2miqRvsobOqRffLsmMvBVlghLENdejpZ4oFF/HqFK92WD2+E3/wB45JcefQo9ujFBMWNm6LYYRv/tzigb4nsDN1bIl9BvyN1OPIHkfat6hrsj3jJbc/0oopvf3rbw4BtT8VxUaZOSS+FLRy12dKf7H7Mf+U8mhTqIundX3nl6ixURrvnLF+8S/jwWT/ab/OLFfJzTcadYCl8jRGTqJdKIsJeDPI4RnOHDfq
Steps to reproduce
When you click the update button to update the component status, the console will report an error
What is expected?
Should not report an error
What is actually happening?
Error:
TypeError: Cannot read properties of null (reading 'emitsOptions')
at shouldUpdateComponent (vue.runtime.esm-browser.js:8774:27)
at updateComponent (vue.runtime.esm-browser.js:7336:9)
at processComponent (vue.runtime.esm-browser.js:7283:7)
at patch (vue.runtime.esm-browser.js:6801:11)
at patchBlockChildren (vue.runtime.esm-browser.js:7155:7)
at processFragment (vue.runtime.esm-browser.js:7233:9)
at patch (vue.runtime.esm-browser.js:6775:9)
at ReactiveEffect.componentUpdateFn [as fn] (vue.runtime.esm-browser.js:7496:9)
at ReactiveEffect.run (vue.runtime.esm-browser.js:525:19)
at ReactiveEffect.runIfDirty (vue.runtime.esm-browser.js:563:12)
System Info
Any additional comments?
I think it may be because the VNode is created at an uncertain time and the blocktree mechanism cannot track it correctly.
Is there a way to solve this error? Or is there an API that can bypass the blocktree mechanism to create a Vnode?
The text was updated successfully, but these errors were encountered: