Has anyone tried to use Kotlin 1.6.20 with the cor...
# compose-web
o
Has anyone tried to use Kotlin 1.6.20 with the corresponding Compose pre-release compiler (
1.2.0-dev-k1.6.20-61e81dadb1c
)? Over here, building the IntelliJ wizard Compose Web demo fails in
compileProductionExecutableKotlinJs
with
Internal error in file lowering: java.util.NoSuchElementException: Collection contains no element matching the predicate.
build.gradle.kts
modified as follows:
Copy code
repositories {
    google()
    mavenCentral()
    maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
    maven("<https://androidx.dev/storage/compose-compiler/repository/>")  // for Compose pre-release compiler
}

// Compose pre-release compiler from <https://androidx.dev/storage/compose-compiler/repository>.
configurations.all {
    resolutionStrategy.dependencySubstitution {
        substitute(module("org.jetbrains.compose.compiler:compiler"))
            .using(module("androidx.compose.compiler:compiler:1.2.0-dev-k1.6.20-61e81dadb1c"))
            .because("using the compose pre-release compiler")
    }
}
The above occurs with
org.jetbrains.compose.web:web-core
and
org.jetbrains.compose.runtime:runtime
versions up to (including)
1.2.0-alpha01-dev609
. For
1.2.0-alpha01-dev617
and above, it changes to
IR lowering failed at: Main.kt [...]
Caused by: java.lang.IllegalStateException: Could not find the singleton lambda for CALL 'internal final fun <get-lambda-1> (): @[ExtensionFunctionType] kotlin.Function3<org.jetbrains.compose.web.dom.ElementScope<org.w3c.dom.HTMLButtonElement>, androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit> declared in .ComposableSingletons$MainKt' type=@[ExtensionFunctionType] kotlin.Function3<org.jetbrains.compose.web.dom.ElementScope<org.w3c.dom.HTMLButtonElement>, androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit> origin=null
Seems there are no compatible artifacts in the JB repository and there is no version check in Compose for this which could provide a more meaningful diagnosis.
h
I would just wait until https://android-review.googlesource.com/c/platform/frameworks/support/+/2020776 is merged in upstream and compose-jb is rebased on this commit.
Isn't 1.2.0-alpha01-dev609 the version published by Google? Google does not support compose-web, does it? https://maven.pkg.jetbrains.space/public/p/compose/dev/org/jetbrains/compose/web/web-core/ there is no 1.6.20 compatible version by JetBrains yet.
o
web-core/1.2.0-alpha01-dev609
metadata mentions
"buildPluginVersion": "1.6.10"
. Don't know if that's indicative of Compose compiler compatibility, as the Compose Gradle plugin is still at 1.6.10 when using the 1.6.20 pre-release compiler. Sure, I can always wait. Nevertheless, to encourage pre-release testing, an early warning about possible artifact incompatibility would be useful, like the one when trying to use Compose with an incompatible Kotlin version.
h
You could try to use
1.2.0-alpha01-dev667
😄 But I still get some errors.
🙏 1