Multiple browser errors regarding replaceChild while using popup-card / layout-card

Hi, this is a bit of a niche issue, but I thought I’d try here before posting an issue on the developer’s github…

I’m using popup-card, layout-card (by @thomasloven) & button-card (by @kuuji)
Recently, might be due to some custom card updates, I see the following errors in HA logs:

(MainThread) [frontend.js.latest.201902200] Uncaught TypeError: Cannot read property 'replaceChild' of null

Additionally, in Chrome I see this stack trace often:

25c44e5d59e2d7eb01278d.chunk.js:3606 Uncaught TypeError: Cannot read property 'replaceChild' of null
    at HTMLElement._rebuildCard (c44e5d59e2d7eb01278d.chunk.js:3606)
    at HTMLElement.element.addEventListener.ev (c44e5d59e2d7eb01278d.chunk.js:3606)
    at fireEvent (app-2a009154.js:1305)
    at customElements.whenDefined.then (c44e5d59e2d7eb01278d.chunk.js:4807)

I tried to understand where does this come from with no luck up until now
Any pointers to get to the bottom of this would be highly appreciated


did you ever find out?

Sadly I didn’t, still having these issues.

Do you use conditional cards? I had those errors when I show no card, (Blanc)

Yes, think I do, to what cards specifically are you referring to ?

Doesn’t matter, of you use conditional, and card is not displayed, it will give error…

Should be fixed in 108

I’ll keep track whether it’ll change, can you refer me to the relevant PR ?

Here you go

Thank you ! looking forward to it.