Chrome Browser Custom Element Error

Allen Kim
1 min readJun 8, 2018

To fix it, we need to do…

Uncaught TypeError: Failed to construct ‘HTMLElement’: Please use the ‘new’ operator, this DOM object constructor cannot be called as a function.

npm install

npm install babel-plugin-transform-es2015-classes babel-plugin-transform-custom-element-classes --save-dev

.babelrc

// include before transform-es2015-classes
{
"plugins": [
"transform-custom-element-classes",
"transform-es2015-classes"
]
}

https://github.com/github/babel-plugin-transform-custom-element-classes

--

--

Allen Kim
Allen Kim

No responses yet