tinymce icon indicating copy to clipboard operation
tinymce copied to clipboard

Failed to construct HTMLElement

Open parthfaladuks opened this issue 3 years ago • 2 comments

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

parthfaladuks avatar Aug 22 '22 10:08 parthfaladuks

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.

hueter avatar Aug 03 '23 23:08 hueter

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.

tiny-stale-bot avatar Aug 03 '24 00:08 tiny-stale-bot

This issue was closed because it has been stalled for 30 days with no activity.

tiny-stale-bot avatar Sep 02 '24 00:09 tiny-stale-bot