Skip to content

Commit 735c848

Browse files
authored
Update editInPlace.js
For HMR compatibility. Fix the javascript error display in console and webpack error overlay : "Failed to execute 'define' on 'CustomElementRegistry': the name "x-trans" has already been used with this registry"
1 parent 589beee commit 735c848

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Resources/public/js/editInPlace.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
// it is not possible to use HTMLElement directly
1212
class XTrans extends HTMLElement {}
1313

14-
customElements.define("x-trans", XTrans);
15-
14+
if (!customElements.get('x-trans')) {
15+
customElements.define("x-trans", XTrans);
16+
}
17+
1618
return;
1719
}
1820

0 commit comments

Comments
 (0)