Failed to construct HTMLElement
I have created custom plugin for conditional block set in tinymce in that i am extending HTMLElement as follows in es6
class ConditionalBlock extends win.HTMLElement
but getting error as follows
Uncaught TypeError: Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
so can you please help me how to extend HTMLElement with es6
tinymce version is 5.0.16
This is an old issue but, I also had this issue from copying the Conditional Blocks example from the Cool TinyMCE Demos repo.
I realized that my bundler (Webpack + SWC) was transpiling to ES5, but web components only work in ES6+
I updated my compilation target to ES6+ and the errors went away.
This issue is stale because it has been open 365 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity.