1

I'm currently trying out coroutines for my kotlin-js project on node.js.

I'm using IntelliJ-Idea and kotlin plugin 1.2.40

Coroutines should be supported, are they? But the "launch"-coroutine is not found by the IDE?!

On the other hand the namespace kotlin.coroutines.experimental is found and i can use for example the suspendCoroutine function but not much else what should actually be available for coroutines.

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

launch as well as async and all the other stuff you use directly is in kotlinx.coroutines, which is not a part of the standard library. The standard library only contains the low-level primitives like suspendCoroutine that you mention.

So you must add a dependency to org.jetbrains.kotlinx:kotlinx-coroutines-core.

Marko Topolnik
  • 195,646
  • 29
  • 319
  • 436