jim
12/13/2021, 9:36 AMimplementation(npm("@js-joda/timezone", "2.3.0"))
to my jsMain
dependencies, and also added a block to the beginning of my Main.kt
file:
@JsModule("@js-joda/timezone")
@JsNonModule
external object JsJodaTimeZoneModule
private val jsJodaTz = JsJodaTimeZoneModule
I build with jsBrowserDistribution
but if I look at the build output javascript file, the very first few lines are:
(function (root, factory) {
if (typeof define === 'function' && define.amd)
define(['exports', '@js-joda/timezone', '@js-joda/core'], factory);
else if (typeof exports === 'object')
factory(module.exports, require('@js-joda/timezone'), require('@js-joda/core'));
else {
if (typeof JsJodaTimeZoneModule === 'undefined') {
throw new Error("Error loading module 'turntaker-js'. Its dependency '@js-joda/timezone' was not found. Please, check whether '@js-joda/timezone' is loaded prior to 'turntaker-js'.");
}if (typeof this['@js-joda/core'] === 'undefined') {
throw new Error("Error loading module 'turntaker-js'. Its dependency '@js-joda/core' was not found. Please, check whether '@js-joda/core' is loaded prior to 'turntaker-js'.");
}root['turntaker-js'] = factory(typeof this['turntaker-js'] === 'undefined' ? {} : this['turntaker-js'], JsJodaTimeZoneModule, this['@js-joda/core']);
}
}(this, function (_, JsJodaTimeZoneModule, $module$_js_joda_core) {
which would seem to imply that the JsJodaTimeZoneModule is not being included, or certainly not being included prior to the check runningDesmond van der Meer
12/14/2021, 7:24 AMDesmond van der Meer
12/14/2021, 7:31 AM^2.5.0
for the version, instead of 2.3.0
, but I can't image that would change much.jim
12/14/2021, 2:28 PMIts dependency '@js-joda/timezone' was not found. Please, check whether '@js-joda/timezone' is loaded prior to 'turntaker-js'
. Given that these are the first few lines of javascript that are run, it is clear by inspection that js-joda is not being initialized prior to the dependency check. The dependency check is the first thing that happens in the module, and the jsJodaTz =
line happens deep within the function scope, after the dependency check.Desmond van der Meer
12/14/2021, 2:36 PM./gradlew run
? For distribution we use the assemble
task, not jsBrowserDistribtution
, perhaps that's the difference?jim
12/14/2021, 3:08 PMgradlew run
will launch the JVM variant. I assume the equivalent you're suggesting would be jsBrowserRun
which seems to build successfully and launches a localhost:8081 but returns a 404 ("Cannot GET /turntaker-js.js") for my main javascript output file.Dmitry Khalanskiy [JB]
12/17/2021, 10:59 AMDmitry Khalanskiy [JB]
12/17/2021, 11:02 AMZac Sweers
01/05/2024, 4:29 AM