I have a @JsExport'd class marked as @Serializable...
# javascript
c
I have a @JsExport'd class marked as @Serializable. However, when I use it in my frontend, I get this error:
Copy code
Unhandled Rejection (SerializationException): Serializer for class 'NewRestaurant' is not found.
Mark the class as @Serializable or provide the serializer explicitly.
My data class:
Copy code
@Serializable @JsExport data class NewRestaurant(val name: String)
Is there something I'm missing?
The code I'm calling with is this (in JS):
t
Is there something I’m missing?
Likes on issues like this 🙂
c
hmm, mine is not in a companion object though
t
serializer()
located in companion? :)
c
ohhhhh