In Kotlin 2.0.20-RC, I’m having trouble with the n...
# eap
c
In Kotlin 2.0.20-RC, I’m having trouble with the new build script syntax. It seems like having a wasmJs target breaks being able to use
jsMain { }
for a source set and I have to fall back to
getByName("jsMain") {}
Copy code
kotlin {
    js()
    jvm()
    @OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
    wasmJs {
        browser()
    }
    sourceSets {
         // Breaks
        jsMain {
            dependencies {
            }
        }
    }
}
The error message is:
Copy code
w: Accessed 'source set jsMain', but js target used a custom name 'wasmJs' (expected 'js'):

Replace:
    kotlin {
        js("wasmJs") /* <- custom name used */
    }

With:
   kotlin {
       js()
   }
youtrack 1
1
a
Cc @bashor, @tapchicoma, @Ilya Goncharov [JB]
i
I think it is an issue KT-70077 It will be fixed in following release
c
Ah, thanks. Yes that looks like the same issue. I’ll try once RC2 is available.