are there any “gotchas” around handling Ktor clien...
# ktor
j
are there any “gotchas” around handling Ktor client responses for the
js
target? I have a Ktor client which is communicating with my API successfully, converting the response body into a
String
, and it works as expected on all JVM and native targets, but I’ve just added a
js
target and while I can see the successful fetch response in Chrome dev tools, if I print the response to the console it is always blank this is the first time I’ve setup my own
js
target in a project, so I wonder if I’ve missed something? content negotiation with json serialization is installed, but I wouldn’t have expected that to make a difference here since I’m just trying to receive the body as a
String
and not another serializable object
a
This functionality should work the same way on the JS target. Can you share a code snippet or your project to troubleshoot the issue?
j
Thanks Aleksei! On my commute home right now and was about to post that I figured it out. It was a dependency configuration issue, and I'll leave the explanation of my mistake here so future explorers can find it if they search for a similar problem. My mistake was mixing experimental Ktor WASM dependencies with my standard ones. I didn't realise I still had a dependency resolution override which forced a dependency to grab the
3.0.0-wasm2
version from the JetBrains experimental maven repo. Somehow it was silently incompatible with one of the others, so there was no visible error or exception 😬