diff --git a/packages/ui/src/app/utils/web-api.ts b/packages/ui/src/app/utils/web-api.ts index 7f4547a9..f6c9942a 100644 --- a/packages/ui/src/app/utils/web-api.ts +++ b/packages/ui/src/app/utils/web-api.ts @@ -84,7 +84,10 @@ export function fixMobileSafariActiveTransition(): void { } export function defineStylesRoot(): void { - customElements.define(globalStylesTag, class TcRootElement extends HTMLElement {}); + if(!customElements.get(globalStylesTag)) { + // A custom element with the same name can be only defined once, + customElements.define(globalStylesTag, class TcRootElement extends HTMLElement {}); + } } /**