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

Marc Dietrichstein

02/05/2021, 7:57 AM
Hi all, This is related to the JS code generated in my multiplatform project. The ktor client gives me
undefined is not an object (evaluating 't.length')
errors when I try to fetch data from a REST endpoint. The problem seems to be related to the buffer module that ktor uses (https://github.com/feross/buffer). It only occurs when using the legacy js backend. Kotlin: 1.4.21 Ktor: 1.5.1 Is anyone familiar with this issue?
I’ve deactivated dce but that didn’t help.
t

turansky

02/05/2021, 2:38 PM
Do you use file level constants?
m

Marc Dietrichstein

02/05/2021, 4:30 PM
Nope, but I am referencing
const val
Strings (header key definitions) which are defined in an
internal object
when creating a request.
t

turansky

02/05/2021, 4:54 PM
Looks like known problem of top vals in legacy
m

Marc Dietrichstein

02/08/2021, 9:00 AM
Thanks for the tip @turansky. I have removed the constants but the issue still persists. Looks like the problem is somewhere else.
t

turansky

02/08/2021, 9:01 AM
What about Kotlin
1.4.30
?
m

Marc Dietrichstein

02/08/2021, 9:59 AM
The same issue 😕
2 Views