Felix
10/23/2024, 1:01 PMIrLinkageError: 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 jsAndWasmSharedbroadway_lamb
10/23/2024, 1:03 PMsynchronized called from your project or from some of its dependencies?Felix
10/23/2024, 2:03 PMTestScope
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).broadway_lamb
10/23/2024, 2:06 PMFelix
10/23/2024, 2:08 PMFelix
10/23/2024, 2:09 PMkotlinx-coroutines-core:1.7.3 and kotlinx-coroutines-test:1.7.3Felix
10/23/2024, 2:09 PMbroadway_lamb
10/23/2024, 2:17 PMrunTest.Felix
10/23/2024, 2:20 PMrunTest.
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.Felix
10/23/2024, 2:22 PM