implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
// include for client-side
implementation("org.jetbrains.kotlinx:kotlinx-html-js:${kotlinxHtmlVersion}")
testImplementation "org.jetbrains.kotlin:kotlin-test-js"
}
`
Also I have a side question - I’ve split my project into two modules - java backend and kotlin/css/html front end, I can execute tasks and build the modules from terminal just fine, single tasks from within intellij also work, but I have a “dangling” grade import button when I edit the build.gradle file of the frontend module, when I click the button the import/reload (whatever intellij calls it) fails.
I had troubles with kotlinx.html also and I think it might be better to avoid it as it is quite low level.
You may check KVision which is a rather big library and example collection for Kotlin/JS with a lot of examples.
I myself decided not to go with KVision but to migrate my previous React based stuff into a full-stack library: Zakadabar Stack with the data model and schemas defined in common code.
In those two projects you may find a lot of examples. The Stack has a sample repo which should work right after cloning, and also template project you can start to kick-off your own.
KVision also has a lot of examples and templates.
KVision is mature, the Stack is under development, take that into consideration.
What I did when I started with Kotlin / Multiplatform was that I read a lot of Ktor and Clikt gradle files.
When you update your project buildscript the gradle cache can sometime end up in an inconsistent state and you get weird errors and inconsistent behaviors. What I do is run gradlew clean after I changed a buildscript, and if it still doesn’t work go into IDEA > File > Invalidate cache/restart. It usually fixes the problem, if not then it’s probably an issue with your script.