iari
05/13/2020, 8:26 AMval LoginContext = createContext<LoginContextData>()
I get the following error
When accessing module declarations from UMD, they must be marked by both @JsModule and @JsNonModuleWhat's wrong?
Björn Mayer
05/13/2020, 8:51 AMcommonJs
for module types (I am not a js expert so sorry for wrong wording).
Your project is probably using a different one.
I solved the issue in my project by setting the module type to AMD
.
This is what I added to my `build.gradle.kts`:
import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackOutput.Target.AMD
tasks.withType<KotlinJsCompile> {
// See <https://github.com/amdjs/amdjs-api/blob/master/AMD.md>
kotlinOptions.moduleKind = AMD
}
Also see: https://kotlinlang.org/docs/reference/js-modules.htmlturansky
05/13/2020, 9:57 AMcommonJs
for wrappers musn’t limit final module kindturansky
05/13/2020, 9:58 AMcreateContext
method?iari
05/13/2020, 5:12 PMuseCommonJs()
to my build.gradle.kts worked for me:
kotlin {
target {
browser {
}
useCommonJs()
}
}
Ilya Goncharov [JB]
05/22/2020, 9:06 AM