https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
i

Ichchha

03/19/2024, 5:48 PM
Hi all, has anyone faced this issue while trying to add Ktor?
c

Casey Brooks

03/19/2024, 5:53 PM
Ktor support for WASM is still in beta, and is expected to be available in Ktor 3.0. You should be ale to test it out now with EAP builds https://kotlinlang.slack.com/archives/C0A974TJ9/p1710759507801069
i

Ichchha

03/20/2024, 5:37 AM
hi @Casey Brooks, thanks for this. I will give it a try. Also are there any alternatives to Ktor that can be used for integrating APIs that supports wasm
j

JPilson Sumbo

03/20/2024, 7:50 AM
I just tried using version
3.0.0-wasm2
but keeping getting
Could not find io.ktor:ktor-client-core:3.0.0-wasm2.
@Ichchha if you get it working please do let me know
j

John O'Reilly

03/20/2024, 12:32 PM
you need to add following (example of use in https://github.com/joreilly/ClimateTraceKMP)
Copy code
maven("<https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental>")
1
i

Ichchha

03/20/2024, 1:46 PM
Thanks @John O'Reilly and @Casey Brooks, the error before is gone but when i run the project I am getting this error related to yarn. I dont think its directly related to ktor, but any of you have idead?
j

John O'Reilly

03/20/2024, 2:05 PM
happens occasionally when using Kotlin/Js Wasm.....you need to run the gradle command mentioned
👍 1
i

Ichchha

03/20/2024, 4:33 PM
Thanks, yeah it went after running the gradle command
@JPilson Sumbo, I was able to fix the issue. Thanks @Casey Brooks and @John O'Reilly. Here is the step by step guide on what you can do: https://medium.com/@ichchhamoktan07/adding-ktor-to-my-kotlin-multiplatform-project-for-web-web-assembly-or-wasm-4f6adad39b73
j

JPilson Sumbo

03/21/2024, 8:41 AM
Yes I was able to solve by adding the repository
👍 1
11 Views