Skip to content

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

@cscxj

Description

@cscxj

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

System:
    OS: Windows 11 10.0.26100
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
    Memory: 9.61 GB / 31.84 GB
  Binaries:
    Node: 16.20.2 - C:\nvm4w\nodejs\node.EXE
    Yarn: 1.22.22 - C:\nvm4w\nodejs\yarn.CMD
    npm: 8.19.4 - C:\nvm4w\nodejs\npm.CMD
    pnpm: 8.15.9 - C:\nvm4w\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.112)

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions