JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.99k stars 1.16k forks source link

1nMakeRasterN32Premul is not defined when running runComposeUiTest with js #4906

Closed eygraber closed 6 days ago

eygraber commented 4 months ago

Describe the bug Running a test with runComposeUiTest with js results in the following failure:

ReferenceError: org_jetbrains_skia_Surface__1nMakeRasterN32Premul is not defined
    at protoOf.makeRasterN32Premul_bcax9f(/tmp/_karma_webpack_412868/commons.js:232015)
    at <global>.SkikoComposeUiTest(/tmp/_karma_webpack_412868/commons.js:86306)
    at SkikoComposeUiTest.init(/tmp/_karma_webpack_412868/commons.js:85856)
    at SkikoComposeUiTest.init(/tmp/_karma_webpack_412868/commons.js:85860)
    at <global>.runComposeUiTest(/tmp/_karma_webpack_412868/commons.js:85844)
    at protoOf.rememberSaveable_remembersTheStateOfHistory_mudg0y(/tmp/_karma_webpack_412868/commons.js:245054)
    at <global>.test_fun$WebHistoryTest_test_fun$rememberSaveable_remembersTheStateOfHistory_test_fun_gx4al3(/tmp/_karma_webpack_412868/commons.js:245065)
    at Context.<anonymous>(/tmp/_karma_webpack_412868/commons.js:246307)

Works fine when running with wasmJs.

Affected platforms

Versions

Additional context Using these dependencies with my shared source set that includes js and wasmJs:

    webTest {
      dependencies {
        implementation(kotlin("test"))

        @OptIn(ExperimentalComposeLibrary::class)
        implementation(compose.uiTest)
      }
    }
eymar commented 3 months ago

I think karma config is needed in your project: https://github.com/JetBrains/compose-multiplatform/blob/master/components/resources/library/karma.config.d/wasm/config.js

Do you have something like this for k/js?

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.