We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8fb3ba commit 6e4b571Copy full SHA for 6e4b571
1 file changed
src/register.ts
@@ -12,10 +12,13 @@ export function register(classObject: CustomElement): void {
12
.replace(/([A-Z]($|[a-z]))/g, '-$1')
13
.replace(/(^-|-Element$)/g, '')
14
.toLowerCase()
15
- if (!window.customElements.get(name)) {
+
16
+ try {
17
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
18
// @ts-ignore
19
window[classObject.name] = classObject
20
window.customElements.define(name, classObject)
21
+ } catch {
22
+ // silently ignore
23
}
24
0 commit comments