Skip to content

[scoped-custom-element-registry] Pulling in from multiple components on a page results in "Illegal constructor (custom element class..." error. #615

Open
@jmurrayri

Description

@jmurrayri

Description

We are in an environment where scoped-custom-element-registry is being pulled in multiple times on a page (from the page itself and at least one component of the page). This was supported in 0.0.9. After upgrading to 0.0.10, we are now getting the error "Illegal constructor (custom element class..." and the page breaks.

Example

Steps to reproduce

Import scope-custom-element-registry from multiple places on a single page.

Expected behavior

Import is conditional, and essentially ignored if the component is already imported.

Actual behavior

The following error is thrown:

"Illegal constructor (custom element class must be registered with global customElements registry to be newable)"

Version

@webcomponents/[email protected]

Browsers affected

  • Chrome
  • Firefox
  • Edge
  • Safari
  • IE 11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions