rsocket / rsocket-kotlin

RSocket Kotlin multi-platform implementation
http://rsocket.io
Apache License 2.0
552 stars 37 forks source link

Kotlin/Js compilation failed with missing dependency error. #201

Closed sureshg closed 2 years ago

sureshg commented 2 years ago

After updating to new version, KotlinJs compilation failed with the following error.

This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!

e: Module "io.rsocket.kotlin:rsocket-core" has a reference to symbol kotlinx.coroutines.flow/collect|7051880022478496626[0]. Neither the module itself nor its dependencies contain such declaration.

This could happen if the required dependency is missing in the project. Or if there is a dependency of "io.rsocket.kotlin:rsocket-core" that has a different version in the project than the version that "io.rsocket.kotlin:rsocket-core" was initially compiled with. Please check that the project configuration is correct and has consistent versions of all required dependencies.

The list of "io.rsocket.kotlin:rsocket-core" dependencies that may lead to conflicts:
1. "kotlin" (a library with unknown version)
2. "io.ktor:ktor-io" (a library with unknown version)
3. "org.jetbrains.kotlinx:atomicfu" (a library with unknown version)
4. "org.jetbrains.kotlinx:kotlinx-coroutines-core" (a library with unknown version)

Dependencies updated are,

    kotlin("js") version "1.6.10"
    kotlin("plugin.serialization") version "1.6.10"

    ....
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-RC3")
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.1")
    implementation(enforcedPlatform("io.ktor:ktor-bom:1.6.7"))
    implementation("io.ktor:ktor-client-js")
    implementation("io.ktor:ktor-client-websockets")
    implementation("io.rsocket.kotlin:rsocket-core:0.14.3")
    implementation("io.rsocket.kotlin:rsocket-transport-ktor-client:0.14.3")
olme04 commented 2 years ago

looks like after https://github.com/Kotlin/kotlinx.coroutines/pull/3047 coroutines 1.6.0 isn't backward compatible when using simple Flow<T>.collect(action) which is used inside rsocket-core

sureshg commented 2 years ago

@olme04 thanks. Revered coroutines to 1.5.2 and it's working fine. Thanks!