<https://github.com/JetBrains/kotlin-playground> H...
# random
f
https://github.com/JetBrains/kotlin-playground How can you import Kotlin libraries in this?
Some failing code (unresolved reference: kotlinx):
Copy code
<code data-target-platform="js" data-js-libs="<https://cdn.jsdelivr.net/npm/kotlinx-html@0.6.12/kotlinx-html-js.min.js>">
import jquery.jq
import kotlinx.html.*
    fun main(){

    jq(".code").html("Asdfasdf")
}

</code>
g
Don't know why it's not working. We have no problem: https://play.data2viz.io/tutorials/getting-started/
Do you see the loading in your network tab?
f
Yes it does load it after I run it
Any code example of doing this? I've tried using local files as well
Maybe It's the version? I use
<https://unpkg.com/kotlin-playground@1>
g
It shouldn't. Try to clone the project and run the example. There is one that uses an external js library. You should then align your code with it.
f
Copy code
FAILURE: Build failed with an exception.

* What went wrong:
Method com/github/jengelman/gradle/plugins/shadow/internal/DependencyFileCollection.getBuildDependencies()Lorg/gradle/api/tasks/TaskDependency; is abstract
­čĄö
Fixed the build error
OK, the reason your site works is because you have
Copy code
data-server="<https://compile.data2viz.io>"
So do I need to host a server with my library so I can run it in an HTML page?
g
Sorry I forgot that point. Yes, we have a server with our specific libraries. See https://github.com/JetBrains/kotlin-web-demo/blob/master/versions/1.3.40/build.gradle
f
Is there no way to have the built-in server accept my kotlin library?
g
No, the compiler needs the dependency to compile/transpile your code.
­čśú 1