Hi all, I think I am having issues with loading a ...
# javascript
r
Hi all, I think I am having issues with loading a JS Module. - I have
yarn add tracking
- tracking == https://github.com/eduardolundgren/tracking.js - Verified that the code in node_modules is the same code as I am seeing in github - I am trying to interface with this specific object: https://github.com/eduardolundgren/tracking.js/blob/master/src/trackers/ObjectTracker.js - In JS you would just load it as so:
let tracker = new tracking.ObjectTracker(" .. ")
I have tried several variations of:
Copy code
@file:JsModule("tracking")
package tracking
external class ObjectTracker(classifiers: String = definedExternally){ // implementation elided }
and any way I mess with all of the
@file:Js
or
@Js
annotations where the module is actually loaded, any time I call
tracking.ObjectTracker()
I get this error:
TypeError: ObjectTracker is not a constructor
Since the actual implementation of it is of a scoped function I tried to make
ObjectTracker
a function that returns an interface, but then I get this error:
TypeError: ObjectTracker is not a function
Anyone have an idea what I am doing wrong?