I'm not able to use `js { binaries.library() }`, i...
# javascript
a
I'm not able to use
js { binaries.library() }
, it gives me the following error when syncing or building the project.
binaries.executable()
works fine though. Did someone encounter this issue?
Copy code
Unable to find method ''java.util.List org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainer.library$default(org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainer, org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation, int, java.lang.Object)''
'java.util.List org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainer.library$default(org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainer, org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation, int, java.lang.Object)'
Was able to workaround as follows for now.
Copy code
js {
    browser()
    binaries::class.java.getMethod("library").invoke(binaries)
}
v
Can you share an MCVE?
a
I will try, but that might be tricky to reproduce. Might be specific to my work environment. Currently I noticed that this happens on upgrade from Kotlin 1.9.30 to 2.0.10.
v
Well, works fine here with 2.0.20
a
Yeah, I know. But not in that particular project.