I'm using Kotlin/JS with IR compiler: ```kotlin { ...
# ksp
j
I'm using Kotlin/JS with IR compiler:
Copy code
kotlin {
    js(IR) { ... }
}
and when I try to add ksp:
Copy code
plugins {
    ...
    kotlin("js") version "1.6.10"
    id("com.google.devtools.ksp") version "1.6.10-1.0.2"
}
it gives me this error:
Copy code
You already registered Kotlin/JS target with another compiler: legacy
Googling indicates that ksp does support IR, I think? What am I doing wrong?
j
KSP does support IR, the error message looks like some other build config issues? do you have the full picture of the build script?
j
Here is my full build.gradle.kts:
Copy code
plugins {
    kotlin("js") version "1.6.10"
    id("com.google.devtools.ksp") version "1.6.10-1.0.2"
}

group = "com.example"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

dependencies {
    implementation("io.arrow-kt:arrow-optics:1.0.2-alpha.42")
//    ksp("io.arrow-kt:arrow-optics-ksp-plugin:1.0.2-alpha.42")

    implementation(kotlin("stdlib-js"))

    testImplementation(kotlin("test"))
}

kotlin {
    js(IR) {
        binaries.executable()
        nodejs {}
    }
}
And here is the error, which points at the
js(IR)
line:
Copy code
You already registered Kotlin/JS target with another compiler: legacy
(commenting out the ksp plugin removes this error)
j
Thanks, I’ll take a look maybe tomorrow
j
On the advice of someone in #javascript I tried switching to a multiplatform project, and that seems to have solved the IR/LEGACY issue. But, now I'm seeing this other issue.