Kotlin2Js WebExtension Error

I tried to make a WebExtension for Firefox following this tutorial: Your first Firefox (Web)extension in Kotlin | by Kirill Rakhman | Medium

My problem occurs when I try to iterate over ArrayLists of org.w3c.dom.Element, for Example

document.getElementsByTagName("div")
    .asList()
    .toList()
    .forEach { console.info(it) }

crashes with TypeError: throwCCE is not a function at

ArrayList.prototype.get_za3lpa$ = function (index) {
      var tmp$;
      return (tmp$ = this.array_hd7ov6$_0[this.rangeCheck_xcmk5o$_0(index)]) == null || Kotlin.isType(tmp$, Any) ? tmp$ : throwCCE();
};

I also don’t know why throwCCE is not defined at this point but i think the actual problem lies in the Koltin.isType function, as

console.info(js("Kotlin.isType(document.getElementsByTagName(\"div\")[0], Object)"))

prints false which would explain the error (I think Object in this context is the same as Any in the previous snippet?)

I created a project to reproduce the error here: Bitbucket

Hope someone can help me :slight_smile:

The problem with throwCCE is not a function sounds like as an issue in DCE. Could you please check it w/o DCE and file an issue.

Which version of browser do you use? How do you run the code, as extesnsion?
Could you please check that this prints for you?

For me it prints:

Hello, world!
[object HTMLDivElement]
[object HTMLDivElement]
true