fix: Fix custom element does not exist error which may arise under specific circumstances#1152
Draft
dcapslock wants to merge 1 commit into
Draft
fix: Fix custom element does not exist error which may arise under specific circumstances#1152dcapslock wants to merge 1 commit into
dcapslock wants to merge 1 commit into
Conversation
…ecific circumstances
Collaborator
|
I don't really understand why this is happening (lack of enough javascript knowledge...), but if the proper way to fix this once and for all is to load cards through |
This was referenced Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1150
This is hard to replicate. To do so I set the initial values of helpers to undefined and then delayed calling the helperPromise in _createCard. Even then it only happens for me 1 out of 10 or so.
This PR may not be the best way. The crux of the matter is that Frontend does not await import of lazy loaded stock cards like it does for dialogs. Perhaps createThing is not needed anymore and solely rely on createCardElement and only show 'Loading...' while cardHelpers are not defined, allowing the recovery logic in createCardElement to handle the lazy loading, which it does, including recovering from not awaiting the import.
The PR as is provides for least risk as far as changes to button-card. However I am happy to look for alternatives. Two in mind:
${until(thing), "Loading..."}orhui-cardwrapper which may break card-mod config users have, and perhaps other things I have not thought of.PR in draft to allow for discussion.