Hello everybody. I faced the problem with coroutin...
# javascript
o
Hello everybody. I faced the problem with coroutine contexts in Kotlin JS. It changes the name of getting function and as a result
CoroutineContext#get
returns
is not a function
error when it is underhood have wrong name (compiled name in my case is
t.get_9uvjra_k$
, but called is
t.get_1pi7hg_k$
). Maybe somebody know how to fix it?
a
Coroutines are not made to be invokable from js. They aren't even marked as exported. That behavour is expected. How are you attempting to invoke your coroutines?
o
from kotlin js
which is built with
compileProductionExecutableKotlinJs
into js
a
No you should not do that. export a function that spawns a coroutine. If you'd elaborate your use case, it would be much better
o
I am getting coroutine context inside of kotlin
I do not interact with coroutines in vanilla JS
a
then, that shouldn't happen at all
o
I should not use kotlin coroutines in kotlin?
a
that's not what I am saying. What I mean is, if you are using Coroutines inside kotlin and you are getting that error, It shouldn't happen. Do file a bug
👍 1
o
I hoped somebody will help at least to create a bug. I do not know how to reproduce it, because of this issue happens only in one of my projects
a
It is a bit hard to file (or help file) a bug without a good reproducer. At the moment, you have the code that exhibits such behaviour. Maybe if you shared just that piece I (or someone else) might help look into jt
o
So, problem was related to the fact that in parent lib I used kotlin 1.6.10 and in the endpoint app - 1.6.21. My mistake, sorry