lit / lit-element

LEGACY REPO. This repository is for maintenance of the legacy LitElement library. The LitElement base class is now part of the Lit library, which is developed in the lit monorepo.
https://lit-element.polymer-project.org
BSD 3-Clause "New" or "Revised" License
4.49k stars 319 forks source link

'enableUpdating is not a function' when dynamically appending to element to the DOM #1175

Closed brewsoftware closed 2 years ago

brewsoftware commented 3 years ago

Description

error thrown when adding a component to a dom dynamically `this.enableUpdating is not a function' when appending a node to the dom which inherits LitElement.

It's being called in the connectedCallback function after the item is appended.

Live Demo

Unfortunately it's a mess and I've confirmed the bug by rolling the framework for https://shoelace.style back to the previous stencilJS version which doesn't have the issue. (https://github.com/shoelace-style/shoelace). I've also confirmed the issue with the material web components and it's the same (https://github.com/material-components/material-components-web-components)

This can be done by creating a custom component in GrapesJS and dragging it into the frame view module for editing. (https://github.com/artf/grapesjs)

Steps to Reproduce

TBA: This is a bit convoluted to re-produce but I can maybe do a gist if needed with the grapesjs implementation.

Expected Results

The component renders

Actual Results

The component fails to render and an error is thrown with 'this.enableUpdating is not a function' from the LitElement source

Browsers Affected

sorvell commented 2 years ago

Closing due to age. Please re-open with a live reproduction if there's still an issue here. Thanks.