Description
I am not sure why but I currently have a situation where marker.parentElement in experimental-hydrate.ts is null.
https://github.com/lit/lit/blob/main/packages/lit-html/src/experimental-hydrate.ts#L161-L164
when I check the code I see this
const parent = marker.parentElement!;
if (parent.hasAttribute('defer-hydration')) {
parent.removeAttribute('defer-hydration');
}
adding check so that parent can not be null seems to make it work.
e.g.
const parent = marker.parentElement!;
- if (parent.hasAttribute('defer-hydration')) {
+ if (parent && parent.hasAttribute('defer-hydration')) {
parent.removeAttribute('defer-hydration');
}
Is that just a missing check? or is there a 0 chance that parentElement is ever null? If so I need to check why it's null in my case...
Description
I am not sure why but I currently have a situation where
marker.parentElementinexperimental-hydrate.tsis null.https://github.com/lit/lit/blob/main/packages/lit-html/src/experimental-hydrate.ts#L161-L164
when I check the code I see this
adding check so that
parentcan not be null seems to make it work.e.g.
Is that just a missing check? or is there a 0 chance that
parentElementis ever null? If so I need to check why it's null in my case...