diff --git a/libs/core/src/lib/components/layout/layout.ts b/libs/core/src/lib/components/layout/layout.ts index 238bcd1..b70eaba 100644 --- a/libs/core/src/lib/components/layout/layout.ts +++ b/libs/core/src/lib/components/layout/layout.ts @@ -337,12 +337,6 @@ export class BergLayoutElement extends WebComponent { } } -try { +if (!customElements.get(BERG_LAYOUT_TAG_NAME)) { customElements.define(BERG_LAYOUT_TAG_NAME, BergLayoutElement); -} catch (e) { - console.warn( - `${BERG_LAYOUT_TAG_NAME} is already defined as a web component.` - ); - - throw e; } diff --git a/libs/core/src/lib/components/panel/panel.ts b/libs/core/src/lib/components/panel/panel.ts index 39be41a..19604eb 100644 --- a/libs/core/src/lib/components/panel/panel.ts +++ b/libs/core/src/lib/components/panel/panel.ts @@ -621,7 +621,7 @@ export class BergPanelElement extends WebComponent {
-
+
`; @@ -641,9 +641,6 @@ export class BergPanelElement extends WebComponent { } } -try { +if (!window.customElements.get(BERG_PANEL_TAG_NAME)) { customElements.define(BERG_PANEL_TAG_NAME, BergPanelElement); -} catch (e) { - console.warn(`${BERG_PANEL_TAG_NAME} is already defined as a web component.`); - throw e; }