Skip to content

fix(hmr):using customElements after hmr will trigger an error#6973

Open
ysy945 wants to merge 1 commit intovuejs:mainfrom
ysy945:patch-7
Open

fix(hmr):using customElements after hmr will trigger an error#6973
ysy945 wants to merge 1 commit intovuejs:mainfrom
ysy945:patch-7

Conversation

@ysy945
Copy link
Copy Markdown
Contributor

@ysy945 ysy945 commented Oct 27, 2022

  • problem link
  • when I use customElements it's ok. but after changing file will trigger hmr.,it will be rerun window.customElements.define. so there is an error will be caused.
    image
  • I think just need to set a cache to check that customElement has been registered or not.

@ysy945
Copy link
Copy Markdown
Contributor Author

ysy945 commented Oct 30, 2022

@sxzz Excuse me, do you have time to review this pr. thanks

@edison1105
Copy link
Copy Markdown
Member

I think this is outside the scope of vue. the developers should ensure that custom elements are not registered many times.
Playground

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants