WebReflection / hyperHTML-Element

An extensible class to define hyperHTML based Custom Elements.
ISC License
202 stars 25 forks source link

Console Error/Rendering Issue in ES5 Test Page #61

Closed danmckeon closed 5 years ago

danmckeon commented 5 years ago

There is an error in the console on the es5 test page on Chrome version 76 and the "it worked" link is not rendering.

Error is as follows:

Uncaught TypeError: Failed to construct 'HTMLAnchorElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
    at MyLink.Intermediate (es5.js?_=0.48887823511286244:2397)
    at new MyLink (test.es5.js?_=0.18174445391217642:154)
WebReflection commented 5 years ago

You don't need Chrome there, that's a test page for IE

danmckeon commented 5 years ago

is there a way to produce code that renders for both modern browsers and IE or does different code need to be served based on browser?

danmckeon commented 5 years ago

I've been trying to use Babel but am receiving this error (when accessing with Chrome):

Uncaught TypeError: Cannot call a class as a function
WebReflection commented 5 years ago

You need the right transpiler, namely Babel 7

Live example: https://codepen.io/WebReflection/pen/yLBROJK