I'm using kotlin.js.Promise.await (kotlinx.corouti...
# compose-web
p
I'm using kotlin.js.Promise.await (kotlinx.coroutines.await extension function) in webMain target. While running app for Js or WasmJs it compiles fine. But when running unit tests during Gradle build process it fails to compile with unresolved reference message for kotlinx.coroutines.await What might be wrong?
m
Are the tests located in webTest?
p
Tests are in common.
@Artem Kobzar For
Copy code
window.navigator.clipboard.writeText
Returns: Promise<Unit> for Js target Promise<Nothing?> for WasmJs target So in webMain for one of targets there will be unresolved reference Is it an issue? Using kotlinx-browser:0.5.0
m
These APIs are not available in common code. They are only available in the web targets.
The unresolved reference may be related to this issue which I reported recently. https://github.com/Kotlin/kotlinx.coroutines/issues/4526
p
Yes. That is my case. Now as a workaroung for my case explicit casting to Promise<Unit> solves this problem.
a
@PHondogo we solved the issue in kotlinx-browser for the signature difference and in webMain it will be the same as in
wasmJs
thank you color 1
I would use the same "solution" (it's just a suppression -_-) for the coroutines