Hello. I'm following the newest guide of setting up a Kotlin/JS project with Gradle (https://kotlinlang.org/docs/reference/js-project-setup.html) but I can't seem to import any gradle dependencies in the main.kt file (unresolved reference). Specifically, the JSoup Java library. I can see all the classes of the library in the External Libraries folder in the IDE. I tried importing the same library as a gradle dependency in a Kotlin/JVM project and it works flawlessly. Does anyone have a clue what might be going on?
s
Sebastian Aigner
01/19/2020, 1:38 PM
Hi! If you’re targeting Kotlin/JS, you won’t be able to use Java libraries. Libraries available are Kotlin Multiplatform Libraries and NPM Packages.
👍 1
g
Grantas33
01/19/2020, 3:06 PM
Thanks! Also, do multiplatform library suspend functions automatically compile to non-blocking js code?
i
iseki
01/20/2020, 9:38 PM
Looks not. Coroutine has its own way to implement it.