Hello, I’ve applied the plugin, added dependencies...
# serialization
g
Hello, I’ve applied the plugin, added dependencies in an MPP and annotated any class I send with @Serializable. I’ve got a response in the format of Response<SomeModel> to parse in kotlin js (node). The error I get is the following:
Copy code
TypeError: tmp$.serializer is not a function at compiledSerializer (<http://localhost:9000/bundle.js:44171:87>) at serializer (<http://localhost:9000/bundle.js:36889:22>) at KotlinxSerializer.lookupSerializerByType_0 (<http://localhost:9000/bundle.js:54654:64>) at Coroutine$read_ro165m$.doResume (<http://localhost:9000/bundle.js:54591:40>) at KotlinxSerializer.read_ro165m$ (<http://localhost:9000/bundle.js:54621:21>) at Coroutine$JsonFeature$Feature$install$lambda_0.doResume (<http://localhost:9000/bundle.js:54456:63>) at <http://localhost:9000/bundle.js:54488:21> at SuspendFunctionGun.loop_0 (<http://localhost:9000/bundle.js:62922:16>) at <http://localhost:9000/bundle.js:62879:31> at SuspendFunctionGun.proceed (<http://localhost:9000/bundle.js:62887:49>)
message: "tmp$.serializer is not a function"
Any idea? -> Seems like the problem comes from generics? I’ve just tried sending a simple model as response and this worked. So what’s the deal with generics?
s
Think so. To create response serializer, you should use smth like
Response.serializer(SomeModel.serializer())
g
Ok, will check that, thanks