Skip to content

Issues with custom elements & @wire #1801

Open
@priandsf

Description

@priandsf

Description

The @wire adapters are not invoked on web components instantiated added as custom elements ion certain cases.

Steps to Reproduce

Clone this sample project that shows the issue: https://github.com/priandsf/lwc-wire-customelement
Execute it, and you can see "Hello world" string provided by the wire adapter. The LWC component is created using createElement(), it works.
Now change the CUSTOM_ELEMENT constant in options.js to true. The LWC component is now created through a custom element in the markup, and the string doesn't appear anymore. The wire adapter is not invoked at all, breakpoints are not hit in the debugger.
Last test: change template.html in /public, by moving the lwc-component script tag above the custom element tag. Then it works again.

Looks like a life cycle issue when the custom element is instantiated.

Playground cannot be used for this issue. Provided a Github repo instead

Browsers Affected

all

Version

  • LWC: 1.4.0

Activity

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

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