Skip to content
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

defineAsyncComponent custom element emit not firing #7293

Closed
SavkaTaras opened this issue Dec 7, 2022 · 3 comments · Fixed by #7296
Closed

defineAsyncComponent custom element emit not firing #7293

SavkaTaras opened this issue Dec 7, 2022 · 3 comments · Fixed by #7296
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements

Comments

@SavkaTaras
Copy link

SavkaTaras commented Dec 7, 2022

Vue version

3.2.45

Link to minimal reproduction

https://github.com/funkso2010/vue3-cus-el-emit

Steps to reproduce

Pull project locally.
npm install (this installs the latest vue version)
npm run preview

What is expected?

dist/index.html
for both buttons to trigger console.log()

What is actually happening?

A button that uses defineAsyncComponent is not firing console.log()

System Info

System:
    OS: macOS 12.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 1.05 GB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.20.0 - /usr/local/bin/node
    Yarn: 1.22.17 - ~/.npm-global/bin/yarn
    npm: 6.14.17 - /usr/local/bin/npm
  Browsers:
    Chrome: 108.0.5359.94
    Safari: 16.1

Any additional comments?

This is intended for breaking large library into small files, instead of loading one giant file.

@baiwusanyu-c
Copy link
Member

I think this is a bug. In the process of rendering the content of the custom element wrapped by defineAsyncComponent, if it is bound to an attribute, such as id, then its vnode will be used by the cloneVNode method Cloning, but the cloning of the ce attribute was omitted during cloning, resulting in being parsed into a normal component, and finally the event could not be triggered。
wdyt?@sxzz

@LinusBorg LinusBorg added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements labels Dec 8, 2022
@SavkaTaras
Copy link
Author

Hello @baiwusanyu-c @LinusBorg ,

Thanks for being so prompt on solving the issue. Hopefully PR will be merged in the next release :).

Regards,
Taras

@SavkaTaras
Copy link
Author

Hello @baiwusanyu-c ,
I hope you are well.

Is that an issue that the e2e test failed per your change?

Thanks,
Taras

chrislone pushed a commit to chrislone/core that referenced this issue Feb 4, 2023
zhangzhonghe pushed a commit to zhangzhonghe/core that referenced this issue Apr 12, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants