We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 113edda commit 4979d09Copy full SHA for 4979d09
1 file changed
src/register.ts
@@ -18,7 +18,11 @@ export function register(classObject: CustomElement): void {
18
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
19
// @ts-ignore
20
window[classObject.name] = customElements.get(name)
21
- } catch {
22
- // silently ignore
+ } catch (e: any) {
+ // The only reason for window.customElements.define to throw a `NotSupportedError`
23
+ // is if the element has already been defined.
24
+ if (e instanceof DOMException && e.name === 'NotSupportedError') return
25
+
26
+ throw e
27
}
28
0 commit comments