Using Compose for Web (WASM) version 1.5.10-dev-wa...
# compose-web
j
Using Compose for Web (WASM) version 1.5.10-dev-wasm01 with Kotlin Version 1.9.20-RC (The same versions as in wasm-examples). I get the error:
Copy code
Could not find org.jetbrains.kotlin:kotlin-stdlib-wasm:1.9.20-RC
The reason it doesn’t exist is obviously because I want
org.jetbrains.kotlin:kotlin-stdlib-wasm-js:1.9.20-RC
instead. I only get this error when adding
Copy code
implementation(compose.material3)
The other Compose libraries compiles fine.
I got it to compile by adding
Copy code
implementation(compose.material3) {
    exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-wasm")
}
so this is more of a heads-up.
j
fwiw there's example with those versions in https://github.com/joreilly/PeopleInSpace
in
compose-web-wasm
module....also some related settings in main
build.gradle.kts
j
@John O'Reilly The issue seems to be specific to
compose.material3
, which I don't think you use in your projects (you use
compose.material
) But thanks a lot for some PoCs with the versions!
👍 1
j
I tried updating PeopleInSpace to use material3 for that wasm module and it at least seems to build ok (though UI not being displayed for some reason now!) https://github.com/joreilly/PeopleInSpace/pull/267
o
🤔 This k/wasm example (https://github.com/Kotlin/kotlin-wasm-examples/blob/main/compose-imageviewer/shared/build.gradle.kts) uses compose.material3 too. And it runs fine. Would it run for you? Is there any difference between it and your project setup? _ I rechecked that example again and I confirm that it runs fine (Chrome Beta).
j
I'm getting following in Chrome Beta when using material3
Copy code
PeopleInSpace.uninstantiated.mjs:13 Uncaught TypeError: Failed to resolve module specifier '@js-joda/core'
    at instantiate (PeopleInSpace.uninstantiated.mjs:13:67)
    at load.mjs:7:11
o
We aim to reduce the boilerplate needed for CfW projects, but for now here is what needed for the problem with js-joda: • To add this file: https://github.com/Kotlin/kotlin-wasm-examples/blob/main/compose-imageviewer/webApp/webpack.config.d/boilerplate.js • To have this file: https://github.com/Kotlin/kotlin-wasm-examples/blob/main/compose-imageviewer/webApp/src/wasmJsMain/resources/load.mjs (with correct uninstantiate file name on the first line) • index.html should use a usual js file (not uninstantiated like it used to be before) https://github.com/Kotlin/kotlin-wasm-examples/blob/main/compose-imageviewer/webApp/src/wasmJsMain/resources/index.html#L8
j
ok, thanks....will try that.. @Justin Salér I think in your case you were running in to issues just building project?
if so, perhaps you can compare with PeopleInSpace .....look at
build.graide.kts
for example with
resolutionStrategy
stuff there
j
@Oleksandr Karpovich [JB] Thank you!
Copy code
if (requested.module.name.contains("kotlinx-serialization") &&            requested.version == "1.5.2-wasm0") {
            useVersion("1.6.1-wasm0")
        }
Seems like the issue was in kotlinx-datetime. And this code solved it! 🤦‍♂️
122 Views