Hola, I'm trying Ktor in wasm and I get this exce...
# webassembly
b
Hola, I'm trying Ktor in wasm and I get this exception
Copy code
process is not defined
ReferenceError: process is not defined
    at io.ktor.util.logging.getKtorLogLevel (webpack-internal:///./kotlin/xxxxxxClient.uninstantiated.mjs:5468:68)
    at <xxxxxx:xxxxxx-client>.io.ktor.util.logging.getKtorLogLevel__externalAdapter (<http://localhost:8081/xxxxxxClient.wasm:wasm-function[78708]:0x7a9451>)
    at <xxxxxx:xxxxxx-client>.io.ktor.util.logging.<no name provided>.<init> (<http://localhost:8081/xxxxxxClient.wasm:wasm-function[78709]:0x7a94f3>)
    at <xxxxxx:xxxxxx-client>.io.ktor.util.logging.KtorSimpleLogger (<http://localhost:8081/xxxxxxClient.wasm:wasm-function[78707]:0x7a9447>)
    at <xxxxxx:xxxxxx-client>.io.ktor.client.plugins.<init properties HttpRequestLifecycle.kt> (<http://localhost:8081/xxxxxxClient.wasm:wasm-function[80372]:0x7c8ecf>)
    at <xxxxxx:xxxxxx-client>.io.ktor.client.plugins.<get-HttpRequestLifecycle> (<http://localhost:8081/xxxxxxClient.wasm:wasm-function[80341]:0x7c8428>)
    at <xxxxxx:xxxxxx-client>.io.ktor.client.HttpClient.<init> (<http://localhost:8081/xxxxxxClient.wasm:wasm-function[79822]:0x7bce21>)
    at <xxxxxx:xxxxxx-client>.io.ktor.client.HttpClient.<init> (<http://localhost:8081/xxxxxxClient.wasm:wasm-function[79828]:0x7bd02c>)
    at <xxxxxx:xxxxxx-client>.io.ktor.client.HttpClient (<http://localhost:8081/xxxxxxClient.wasm:wasm-function[79845]:0x7bd451>)
    at <xxxxxx:xxxxxx-client>.com.xxxxxx.core2.http.httpClient$lambda$lambda.invoke (<http://localhost:8081/xxxxxxClient.wasm:wasm-function[83012]:0x7fb603>)
I inject with koin my HttpClient
Copy code
HttpClient(Js) {
    install(Logging) {
        logger = Logger.DEFAULT
        level = LogLevel.HEADERS

        sanitizeHeader { header -> header == HttpHeaders.Authorization }
    }
}
version for ktor:
3.0.0-beta-2-eap-932
version for client js:
3.0.0-beta-2-eap-932
do you have any idea how to solve or debug ? kr, Ben
a
It's known issue. It could be fixed on the both side (compiler or Ktor). We've fixed it in the compiler and with the 2.0.20 it should work. @Igor Yakovlev is it true that the JS exceptions catching will be landed in 2.0.20?
🤩 1
🥳 1
i
Js exception catching landed in 2.0.0
a
@Benjamin Malengreau what version of the multiplatform plugin do you use?
b
1.9.23 so I will upgrade to 2.0.0
K 1