What could this mean? ```throwLinkageError("Functi...
# serialization
r
What could this mean?
Copy code
throwLinkageError("Function 'encodeToString' can not be called: No function found for symbol 'kotlinx.serialization.json/Json.encodeToString|encodeToString(0:0){0\xA7<kotlin.Any?>}[0]'");
I'm getting this when upgrading a Kotlin/JS project to Kotlin 2.1.20-RC.
I've traced the problem to the
spring-dependency-management-plugin
being applied to the project (it's a fullstack project with JS/WasmJs + JVM targets).
I've had problems with this plugin not long ago - it breaks incremental compilation for K/JS (see: https://youtrack.jetbrains.com/issue/KT-74378). Still I don't get how this JVM plugin can affect K/JS compilation in such ways?!
a
This is a part of partial linkage. The error means that there is no more
kotlinx.serialization.json/Json.encodeToString|encodeToString
with the provided signature. What
kotlinx.serialization.json
version do you use?
r
the latest -
1.8.0
a
@sandwwraith is it something we know about?
s
We've added
encodeToString
as a Json member, but the original extension wasn't removed — https://github.com/Kotlin/kotlinx.serialization/pull/2853/files
So I'm not sure this is related. No other changes were made to this function
r
Everything works ok if I don't apply the spring dependency management plugin. So I think there is something wrong with the plugin or with the Kotlin compiler itself.
I would say the plugin somehow mixes up serialization versions used by the K/JS compiler?
I've managed to reproduce the issue with my github open source project.
Should I open an issue? Where?
a
Could you please open it for Kotlin/JS?
r
Ok
thank you color 1
I've managed to find a solution (a workaround?). I can add
Copy code
extra["kotlin-serialization.version"] = libs.versions.kotlinx.serialization.get()
to my project to force 1.8.0 version for kotlinx.serialization (it seems the default for spring is 1.6.3).
But I would never guess this property can affect K/JS target.
I've updated the issue