What can cause the problem? I have followed this i...
# ktor
a
What can cause the problem? I have followed this instruction: https://ktor.io/docs/client-dependencies.html#plugin-dependency
Copy code
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

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

kotlin {
    @OptIn(ExperimentalWasmDsl::class)
    wasmJs {
       browser()
    }


    
    androidTarget {
        compilations.all {
            kotlinOptions {
                jvmTarget = "1.8"
            }
        }
    }
    
    iosX64()
    iosArm64()
    iosSimulatorArm64()
    
    jvm()
    
    sourceSets {
        commonMain.dependencies {
            implementation(libs.ktor.client.core)
            implementation(libs.ktor.client.okhttp)
        }
    }
}

android {
    namespace = "org.freshood.app.shared"
    compileSdk = libs.versions.android.compileSdk.get().toInt()
    defaultConfig {
        minSdk = libs.versions.android.minSdk.get().toInt()
    }
}
a
https://ktor.io/docs/http-client-engines.html#platforms the OkHttp engine only supports JVM/Android
a
Will native engine work with wasmJS?
a
WasmJS support is coming with Ktor 3.0 IIRC.
a
how i am supposed to do the http request on wasm? is it even possible?
e
wasmJs has no http capability on its own. until other wrappers exist, you can bridge to JS's fetch API
wasmWasi will require a different path, possibly https://github.com/WebAssembly/wasi-http