https://kotlinlang.org logo
Title
l

Luc Girardin

01/19/2021, 2:19 PM
I am trying to create a multiplatform library with both JVM (Compose) and JS target. To do so, I configure it using I am trying to create a multiplatform library with both JVM (Compose) and JS target. To do so, I configure it using
compose.desktop {
    application {
        disableDefaultConfiguration()
        from(kotlin.targets["compose"])
    }
}
With the JS target in legacy mode, everything compile and run just fine. In IR mode I however get the following error:
:compileKotlinJsIr FAILED
e:androidx.compose.compiler.plugins.kotlin.IncompatibleComposeRuntimeVersionException: You are using an outdated version of Compose Runtime that is not compatible with the version of the Compose Compiler plugin you have installed. The compose compiler plugin you are using (version 1.0.0-alpha11) expects a minimum runtime version of 1.0.0-alpha11.
Is there maybe a workaround or is there another option to limit the scope of the Compose plugin?
b

bashor

01/19/2021, 6:26 PM
Am I right that you don’t need a compose for JS part?
@olonho is there a way to disable/enable compose compiler plugin for some targets (compilations)?
o

olonho

01/19/2021, 6:29 PM
Same as with any other plugin, nothing Compose-specific. Maybe just split to different modules?
l

Luc Girardin

01/19/2021, 10:09 PM
@bashor That's correct. I only want one target to use the Compose compiler and API. The JS target don't use Compose at all. @olonho It is necessary to have the two targets in the same module because I use the expect/actual construct a lot.
To follow up, I just created an issue on Github about this (with a sample project to reproduce the problem): https://github.com/JetBrains/compose-jb/issues/352