Skip to content

Card: defer element registration until HA app boots (HA 2026.8 registry race) - #9

Merged
vfilby merged 1 commit into
mainfrom
worktree-card-registry-race
Aug 22, 2026
Merged

Card: defer element registration until HA app boots (HA 2026.8 registry race)#9
vfilby merged 1 commit into
mainfrom
worktree-card-registry-race

Conversation

@vfilby

@vfilby vfilby commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Fixes "Custom element doesn't exist: shade-engine-card" on every dashboard after the HA 2026.8 update. See commit message for root cause; verified 10/10 in headless Chromium against the live server and already deployed there.

🤖 Generated with Claude Code

…registry race)

HA 2026.8's frontend bundles the scoped-custom-element-registry polyfill,
which replaces window.customElements with a fresh registry at app.js
start. The card is loaded via extra_module_url, imported by the index
page concurrently with app.js; with a warm cache it reliably defines on
the native registry before the swap and customElements.get() then returns
undefined -> "Custom element doesn't exist: shade-engine-card" on every
dashboard (browsers and companion apps alike).

Wait for customElements.whenDefined('home-assistant') and define on
whatever registry is current at that point. Verified 10/10 registrations
in headless Chromium against the live server (was ~1 in 6 failing cold,
and consistently failing with a cached module). Bump to 0.5.1 so the
?v= cache-buster refreshes clients.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vfilby
vfilby merged commit a2d7c86 into main Aug 22, 2026
3 checks passed
@vfilby
vfilby deleted the worktree-card-registry-race branch August 22, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant