Feel like I'm losing my marbles... I have a kmp/c...
# ktor
c
Feel like I'm losing my marbles... I have a kmp/cmp app. android/ios/wasm.
Copy code
commonMain.dependencies {
            implementation("io.ktor:ktor-client:3.0.0")
Android works iOS works Running wasm comes with a
Copy code
Could not determine the dependencies of task ':kotlinNpmInstall'.
> Could not resolve all dependencies for configuration ':composeApp:wasmJsNpmAggregated'.
   > Could not resolve io.ktor:ktor-client:3.0.0.
     Required by:
         project :composeApp
      > No matching variant of io.ktor:ktor-client:3.0.0 was found. The consumer was configured to find a library for use during 'kotlin-runtime', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.js.public.package.json' with value 'public-package-json', attribute 'org.jetbrains.kotlin.platform.type' with value 'wasm', attribute 'org.jetbrains.kotlin.wasm.target' with value 'js' but:
FWIW. I'm not setting anything else because ktor is supposed to set engines for me AFAICT. works for android and ios. just not wasm.
u
You have to configure the JS engine for wasm
c
am i wrong in thinking that ktor is supposed to pick the engines automatically if I don't specify one?
c
It will if you add the engine dependency under the wasm sourceset
u
@Cherrio LLC I'm not sure. Have you tried?
c
so i only need to declare it for wasm, and i can leave ios and android blank. am i understanding right? (on mobile. be back at laptop tomorrow)
a
Also, can you try to use the latest release of Ktor 3.1.2?
c
im pinned at using 3.0 for now. but i can try to update to ktor once latest CMP is out in stable
a
Have you managed to resolve the issue by specifying the dependency for the WasmJS target?
c
I ended up quitting on this project for now. couldn't figure it out /shruggie