Closed jorge-vasquez-2301 closed 8 months ago
@jorge-vasquez-2301 in JS modules, this
is not defined. Whereas in JS scripts, this
is the global object. You therefore need to replace the top-level this
references in that file with an actual global reference or an empty object.
ohh ok, that makes sense. Thank you @guybedford!
I'm trying to componentize the following JS file generated by the Scala.js compiler (Scala 3.3.1):
https://gist.github.com/jorge-vasquez-2301/76ba147e39fda32aab07beae552a9dbb
The WIT file is like:
When I try to run the component after transpiling it with
jco
, I get the following error:By the way, when I run the JS file without componentizing, everything works as expected