Closed ahmedre closed 1 year ago
Hi @ahmedre ! I didn't manage to reproduce the error.
I use the following snippet:
fun main() {
onWasmReady {
Window("Test") {
Test()
}
}
}
@Composable
fun Test(blendMode: BlendMode = BlendMode.SrcIn) {
println(blendMode)
}
When I run it, it prints SrcIn
in the brower console.
I guess, there could be something in the project setup.
Do you apply id("org.jetbrains.compose")
plugin? Do you override the compose compiler plugin version or artefact by chance? JFYI: the Jetpack Compose compiler plugin doesn't support k/js and k/native, so Compose Multiplatform compiler plugin has to be used.
If you can share the project where the issue is reproducible, we can try to find out the cause.
Thanks, really appreciate it - while preparing a minimal repro for this, I found the issue - we had some code like:
kotlinCompilerPlugin.set(libs.androidx.compose.compiler.map { it.toString() })
in our Gradle configs that forced the usage of the non-multiplatform Compose compiler instead of the Compose Multiplatform compiler itself. Removing that version override fixes the problem.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Describe the bug On Kotlin 1.8.20, if I add this to my code:
It fails to compile on JS/IR with the following exception:
Note that if you remove the usage of blendMode in this case, it compiles fine. The code works fine on desktop and Android. This might be related to the fact that
BlendMode
is avalue
class that is provided by Compose libraries? Also note that "wrapping" blend mode fixes it (even switching the parameter to a nullable, for example).Previously filed on YouTrack but was asked to file here instead.
Affected platforms Select one of the platforms below:
Versions