https://kotlinlang.org logo
#compose-web
Title
# compose-web
a

Akram Bensalem

03/03/2024, 3:20 PM
I created a module that contain design system of my Kotlin multiplatform project. in desktop (JVM), it works well Meanwhile, when I try to add wasm to it, it doesn't work. Here my module build.gradle.kts file:
Copy code
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
    alias(libs.plugins.kotlinMultiplatform)
    alias(libs.plugins.jetbrainsCompose)
}

kotlin {

    jvm {
        compilations.all {
            kotlinOptions.jvmTarget = "17"
        }
    }

    @OptIn(ExperimentalWasmDsl::class)
    wasmJs {
        moduleName = "designsystem"
        browser {}
        binaries.library()
    }
    
    sourceSets {
        commonMain.dependencies {
            implementation(compose.runtime)
            implementation(compose.foundation)
            implementation(compose.material3)
            implementation(compose.ui)
            implementation(compose.materialIconsExtended)
            implementation(compose.components.resources)
        }

    }
}
I got this error: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':kotlinStoreYarnLock'.
yarn.lock was changed. Run the
kotlinUpgradeYarnLock
task to actualize yarn.lock file
* Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.
BUILD FAILED in 22s Waiting for changes to input files... (ctrl-d to exit)
😞 1
a

Anmol Verma

03/03/2024, 3:30 PM
Did you run kotlinUpgradeYarnLock ?
a

Akram Bensalem

03/03/2024, 3:31 PM
No, what does mean running kotlinUpgradeYarnLock ?
a

Anmol Verma

03/03/2024, 3:31 PM
It’s a gradle task
Search for that in the gradle tab and execute it
🎉 1
a

Akram Bensalem

03/03/2024, 3:34 PM
Yay, It is fixed. Thank you so much 🔥 I run this in terminal: ./gradlew kotlinUpgradeYarnLock
🙌 1
7 Views