im having some issues setting up github actions to...
# javascript
r
im having some issues setting up github actions to build my kotlinJS project? i have the js runtime dependency:
Copy code
implementation(npm("kotlinx-serialization-kotlinx-serialization-core-jslegacy", "1.4.2-RC1"))
and i get error:
Module 'kotlinx-serialization-kotlinx-serialization-core-jsLegacy' not found
> Task :remote:jsBrowserDevelopmentWebpack
do i have to install npm or something to make this work on github actions? or is there some github action i need to use to build kotlinJS on github actions? this is my github actions yaml - the js lib is built and copied to a jar as a resource https://github.com/sentinelweb/cuer/blob/ab00c7a7cd969eafa72b0d28bc5ba5c5c3e099d3/.github/workflows/android.yml
t
r
weird ... it seems that i need to add this npm dependency in
jsMain
Copy code
implementation(npm("kotlinx-serialization-kotlinx-serialization-core-jslegacy", "1.4.2-RC1"))
without it i get an eror on the page saying the lib is missing. or similar fail for webpack as above. or should i add you plugin declaration?
t
serialization-core.js
located inside runtime jar
r
yes it looks like it should be so i must have someething configured incorrectly
i have
Copy code
val commonMain by getting {
    dependencies {
        implementation(project(":shared"))
        implementation("org.jetbrains.kotlinx:kotlinx-datetime:$ver_kotlinx_datetime")
        implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$ver_kotlinx_serialization_core")
        implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$ver_kotlinx_serialization_core")
        implementation("io.ktor:ktor-client-core:$ver_ktor")
        implementation("io.insert-koin:koin-core:$ver_koin")
    }
}
and
Copy code
val jsMain by getting {
    dependencies {
        implementation(npm("kotlinx-serialization-kotlinx-serialization-core-jslegacy", "1.4.2-RC1"))
        implementation("org.jetbrains.kotlinx:kotlinx-datetime-js:$ver_kotlinx_datetime")
        implementation("org.jetbrains:kotlin-react:17.0.1-pre.148-kotlin-1.4.21")
        implementation("org.jetbrains:kotlin-react-dom:17.0.1-pre.148-kotlin-1.4.21")
        implementation(npm("react", "17.0.1"))
        implementation(npm("react-dom", "17.0.1"))
        implementation("org.jetbrains:kotlin-styled:5.2.1-pre.148-kotlin-1.4.21")
        implementation(npm("styled-components", "~5.2.1"))
        implementation(npm("react-youtube-lite", "1.0.1"))
        implementation(npm("react-share", "~4.2.1"))
        implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")

    }
}
if i drop the js legacy - it all breaks
at runtime/webpack
t
1. Following dependencies are redundant:
Copy code
implementation(npm("react", "17.0.1"))
implementation(npm("react-dom", "17.0.1"))
implementation(npm("styled-components", "~5.2.1"))
2. Check which package require
kotlinx-serialization-kotlinx-serialization-core-jslegacy
(version
1.4.2-RC1
is invalid)
r
yeah so i removed react, react-dom and styled-components but still the dependency is needed - I'm unsure why this jsLegacy breaks in my Ci build tho.