Piotr Krzemiński
12/23/2024, 2:26 PM> Task :wasmJsBrowserTest
Disconnected (0 times) , because no message in 30000 ms.
java.lang.IllegalStateException: command '/home/runner/.gradle/nodejs/node-v22.0.0-linux-x64/bin/node' exited with errors (exit code: 1)
I imagine the reason can be anything that causes Node to hang. I found two threads with the similar symptom:
• https://kotlinlang.slack.com/archives/CDFP59223/p1722954099001579?thread_ts=1722925272.045489&cid=CDFP59223 it was something about Compose, and I don't use Compose
• https://kotlinlang.slack.com/archives/CDFP59223/p1717026550065119 - some custom Karma config helped there - it didn't in case of this problem
How can I troubleshoot it? Is it a known issue?Oleksandr Karpovich [JB]
12/23/2024, 2:49 PMPiotr Krzemiński
12/23/2024, 7:32 PMPiotr Krzemiński
12/23/2024, 7:35 PMPiotr Krzemiński
12/24/2024, 9:36 AMOleksandr Karpovich [JB]
12/24/2024, 11:40 AMMaybe I didn't apply the config correctly? Could you verify?Looks correct to me. Would you like to try to update the Kotlin and Kotest versions separately if it's possible? Maybe it would become clear where to report the problem? Do you have the same issue locally or only on the CI?
is there a YouTrack issue to track adding better error reporting without such customizations?Afaik, the error we see is reported by karma, not by Kotlin. _ Increasing the timeout didn't help in our case, but some people say it helped them: https://stackoverflow.com/questions/54744584/karma-disconnected-because-no-message-in-10000-ms
Piotr Krzemiński
12/24/2024, 11:51 AMOleksandr Karpovich [JB]
12/24/2024, 11:52 AMPiotr Krzemiński
12/24/2024, 11:52 AMPiotr Krzemiński
12/24/2024, 11:52 AMPiotr Krzemiński
12/24/2024, 11:53 AMPiotr Krzemiński
12/24/2024, 11:55 AMPiotr Krzemiński
12/24/2024, 12:00 PMOleksandr Karpovich [JB]
12/24/2024, 12:03 PMPiotr Krzemiński
12/24/2024, 12:16 PMOleg Smirnov
01/03/2025, 4:29 PMUncaught (in promise) WebAssembly.Exception { }
without any stack trace (screenshot from Chrome is attached).
Also, I see 404: /absolute/tmp/_karma_webpack_617759/json-schema-validator-root-json-schema-validator-wasm-js-test.wasm.map
message in the console (but I can see that file in the build directory for the wasmJs target). I am not sure if it is connected to the problem, but I don't see this message when running tests on 2.0.21Ilya Goncharov [JB]
01/06/2025, 1:55 PMCan we override karma version provided by Kotlin?Yes, it is possible.
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().versions.karma.version = "..."
}
Oleg Smirnov
01/06/2025, 5:19 PMIlya Goncharov [JB]
01/06/2025, 7:23 PMPiotr Krzemiński
01/07/2025, 7:58 AMIlya Goncharov [JB]
01/07/2025, 9:18 AMOleg Smirnov
01/07/2025, 9:39 AMcommonTest {
dependencies {
//....
runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
}
}
I will push changes and see if it also works on GitHub runner.
Thank you very much, @Ilya Goncharov [JB]!
BTW: if you have some time, could you share details about how you discovered that the problem was related to the linkage process? Maybe some resources to read - I honestly have no idea what could be done with errors like that... Once again, thank you very much!Piotr Krzemiński
01/07/2025, 10:45 AMPiotr Krzemiński
01/07/2025, 11:01 AMIlya Goncharov [JB]
01/07/2025, 11:03 AMcoroutines
for main
source set as well and not just runtime
but honest implementation
dependency?
As for error message, surely it is the problem of the Kotlin/Wasm (I don’t understand if it is a tooling’s bug or compiler’s one).
As for diagnostic, I run test in “debug” mode. I changed singleRun
onto false
in karma.config.js
(build/js/<package-name>-test
)
And browser to Chrome
instead of ChromeHeadless
.
It runs test in prepared Chrome
browser, and you can debug it right in browser.
And I debugged wasm
file (Chrome debug has checkbox “Pause on uncaught exceptions”). It helps to find what exception was thrown.
And actually there were changes with browser API in stdlib.Piotr Krzemiński
01/07/2025, 11:23 AMPiotr Krzemiński
01/07/2025, 11:24 AMDon’t you think that it is better to usee.g. in my case, coroutines are used only in tests, so I don't see a reason to add a production dependency on themforcoroutines
source setmain