https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
d

dasralph

01/03/2021, 11:40 AM
When I try to compile a data class with default values with the IR compiler to JavaScript, I get this error:
IllegalStateException: Can't find name for declaration FUN name:Foo_init_$Create$ visibility:public modality:FINAL <> (bar:kotlin.String?, $mask0:<http://kotlin.Int|kotlin.Int>, $marker:kotlin.js.DefaultConstructorMarker?) returnType:api.model.Foo
. I assume this is a bug but is there a small workaround for it? Or do I need to wait until it is fixed?
Copy code
@ExperimentalJsExport
@JsExport
data class Foo(
    val bar: String? = null
)
a

andylamax

01/05/2021, 4:22 PM
What is the workarround? Also, I am actively building for JS and I haven't gotten that error