loke
02/10/2025, 3:44 PMjava.lang.IllegalStateException: Errors occurred during launch of browser for testing.
- Firefox
Please make sure that you have installed browsers.
Or change it via
browser {
testTask {
useKarma {
useFirefox()
useChrome()
useSafari()
}
}
}
I have exactly this in the gradle file (well, I tried that, and then I changed it to just contain useFirefox()
because that's the only browser I need to test with at the moment. I have read through the Kotlin JS documentation, which doesn't explain anything about how to configure a browser, and I also did some web searches, and got remarkably few hits, and the ones I got were completely irrelevant. Any ideas?Artem Kobzar
02/10/2025, 6:04 PMephemient
02/11/2025, 2:03 AMloke
02/11/2025, 2:30 AMloke
02/11/2025, 2:34 AM/usr/bin/firefox
like on any standard Linux installation)loke
02/11/2025, 2:44 AMorg.jetbrains.kotlin.gradle.targets.js.testing.karma.KotlinKarma
reveals that there is a lot of customisation options that can be used. Are these documented anywhere?ephemient
02/11/2025, 2:55 AMuseFirefoxHeadless()
if it's some graphical setup issueloke
02/11/2025, 2:58 AMModule not found: Error: Can't resolve 'fs' in '/home/elias/prog/array/build/js/packages/array-standalonejs-test/kotlin'
Cannot load browser "FirefoxHeadless": it is not registered! Perhaps you are missing some plugin?
Error: Found 1 load error
ephemient
02/11/2025, 2:58 AMephemient
02/11/2025, 2:58 AMloke
02/11/2025, 2:59 AMloke
02/11/2025, 3:01 AMloke
02/11/2025, 3:01 AMCHROME_BIN
environment variable.loke
02/11/2025, 3:02 AMloke
02/11/2025, 3:05 AMModule not found: Error: Can't resolve 'fs' in '/home/elias/prog/array/build/js/packages/array-standalonejs-test/kotlin'
Cannot load browser "Firefox": it is not registered! Perhaps you are missing some plugin?
loke
02/11/2025, 3:05 AMArtem Kobzar
02/11/2025, 10:32 AMfs
module somewhere?loke
02/11/2025, 12:58 PMvar jsFilesystem: dynamic = js("require('fs')")
.loke
02/11/2025, 12:59 PMloke
02/11/2025, 1:01 PMArtem Kobzar
02/11/2025, 5:29 PM@JsModule("fs")
val jsFilesystem: dynamic
So, as soon as you don't use it, it should be not included into your bundle.loke
02/11/2025, 5:50 PMArtem Kobzar
02/11/2025, 6:03 PMloke
02/14/2025, 3:00 PM@JsModule
and @JsNonModule
but even after I made that change I get the same error.loke
02/14/2025, 3:05 PMval jsFilesystem: dynamic = null
. This ensures that I'm not touching the fs stuff. The message about fs disappeared, but it didn't get me any closer to solving the problem. Here's the log: https://pastebin.com/cUc9a2aGloke
02/14/2025, 3:06 PMArtem Kobzar
02/14/2025, 3:08 PMloke
02/14/2025, 3:14 PMloke
02/14/2025, 3:15 PMArtem Kobzar
02/14/2025, 3:40 PM--debug
flag and attach the log here or in DM?loke
02/14/2025, 5:15 PMArtem Kobzar
02/17/2025, 12:26 PMIlya Goncharov [JB]
02/17/2025, 12:34 PMFIREFOX_BIN
http://karma-runner.github.io/0.13/config/browsers.html#correct-path-to-browser-binary