Hi. I'm getting the following error, both on node ...
# javascript
f
Hi. I'm getting the following error, both on node and browser tests
Copy code
IrLinkageError: Function 'synchronized' can not be called: No function found for symbol 'kotlinx.coroutines.internal/synchronized|-6007400717330569213[0]'
	at <global>.throwLinkageError(REMOVED/compileSync/js/test/testDevelopmentExecutable/kotlin/js/runtime/unlinked.kt:11)
	at TestScopeImpl.protoOf.enter_h49n20(/mnt/agent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestScope.kt:224)
	at <global>.runTest(/mnt/agent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestBuilders.kt:307)
The used
kotlinx-coroutines-test
was upgraded from
1.7.3
to
1.9.0
, due to the upgrade of ktor to
3.0.0
• What can be causing this? • I noticed that
synchronised
uses
synchronizedImpl
, which is an
expect
function. This function is not defined on the
js
target, but seems to be on the
jsAndWasmShared
b
Hi! Was the
synchronized
called from your project or from some of its dependencies?
f
I believe it is from
TestScope
The stack trace starts at one of my tests, in the
runTest
call, then goes into
TestBuilders.kt
and into
TestScope.kt
, which uses the
synchronized
function (I peeked at the source code for it).
b
And does your project explicitly depend on both ktor and kotlinx-coroutines-test?
f
It depends on both.
I have direct dependencies for both
kotlinx-coroutines-core:1.7.3
and
kotlinx-coroutines-test:1.7.3
And for ktor:3.0.0
b
I see. This looks like a bug. Could you please file an issue? kotl.in/issue If possible, please attach your project or at least the test file from which you call
runTest
.
f
Unfortunately I cannot attach the project neither the test file. But it is a simple usage of
runTest
. In the meanwhile, I changed my direct dependencies of
kotlinx-coroutines-*
to use
1.9.0
instead of
1.7.3
and the problem went away.
👍 1
Thanks for the help.