Hey everyone. I’m trying to create a common source...
# multiplatform
z
Hey everyone. I’m trying to create a common source set for JS and Wasm in a Compose project, but both IntelliJ and Android Studio don’t seem to recognize the common libraries/APIs, like
kotlinx.browser
. Building works fine, but the editor itself shows unresolved reference errors and I don’t have code completion/inspection. Looking around the internet, it seems like this should work, but I don’t really know where to go from here. This is my
sourceSets
block:
Copy code
sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(compose.runtime)
                implementation(compose.foundation)
                implementation(compose.material3)
                implementation(compose.ui)
                implementation(compose.components.resources)
            }
        }

        val skikoMain by creating {
            dependsOn(commonMain)
        }

        val jsWasmMain by creating {
            dependsOn(skikoMain)
        }

        val jsMain by getting {
            dependsOn(jsWasmMain)
        }

        val wasmJsMain by getting {
            dependsOn(jsWasmMain)
        }
    }