MrPowerGamerBR
09/11/2025, 7:23 PM@JsName on properties declared on a @JsPlainObject? I wanted to change some snake_case variables into camelCase, to make it look "better" in Kotlin
I tried searching for it, but the only result of someone trying to do this was this conversation: https://kotlinlang.slack.com/archives/C0B8L3U69/p1728428182216839
However after testing it, it doesn't seem to work on Kotlin 2.2.0 😞Marc
09/12/2025, 11:41 AMfun main() {
ubyteArrayOf(
*listOf(ubyteArrayOf())[0]
)
}
results in:
Unhandled JavaScript exception: listOf(...).get_c1px32_k$(...).slice is not a function
https://pl.kotl.in/nEyBqjkBZ
The same code works just fine when replacing ubyteArrayOf with byteArrayOf or running it on JVM instead.CLOVIS
09/13/2025, 4:01 PMedenman
09/16/2025, 8:43 PMAndreas Martin Mørch
09/19/2025, 12:22 PMimplementation(npm(package, version)) does not invalidate build cache?
Kotlin 2.2.0, Gradle 8.12
Running build before and after changing the NPM dependency shows the same build cache key for compileKotlinJs.
I would expect this to trigger a failed build and prompt the user to run kotlinUpgradeYarnLock like normal.Stefan Oltmann
09/21/2025, 3:03 AMBernhard
09/25/2025, 7:59 AM{GridCoordinates2D|HexagonalGridCube2D|Point} HexagonalGridCoordinates2D
and wondered, if there was a way to model that in Kotlin. Couldn't you use a marker interface for that? As in: an empty interface that all of these types extend?Jan Biedermann
09/26/2025, 6:14 AMOliver.O
09/26/2025, 12:33 PMLuv Kumar
09/26/2025, 4:56 PMinit {} block but not only kotlin gives warning for that, it's cumbersome process to add to all exposed classes and would pollute the code as well.Horatio Thomas
09/30/2025, 10:31 AMNickolay
10/03/2025, 10:21 PMArtem Kobzar
10/07/2025, 7:00 AMEdoardo Luppi
10/07/2025, 12:25 PMNickolay
10/09/2025, 4:19 PMcommonMain to JS that can be implemented in Typescript? - Stack Overflow](https://stackoverflow.com/questions/79786639/can-we-expose-interfaces-from-commonmain-to-js-that-can-be-implemented-in-type)MrPowerGamerBR
10/10/2025, 2:12 AMkotlin-browser bindings for Web Components have changed quite a bit, and now I'm not able to get a custom element to workAlex Styl
10/13/2025, 9:26 AMEdoardo Luppi
10/13/2025, 9:41 AMNickolay
10/13/2025, 9:25 PMd.ts to have KDoc comments transferred over to d.ts from the Kotlin files?Chanjung Kim
10/20/2025, 9:21 AMjs(...) intrinsic only supports ES5 syntax. The version of GWT used by the Kotlin/JS compiler also predates the release of the ES6 standard. I couldn't find any official documentation describing the exact behavior of the intrinsic, but is enforcing ES5 kind of a spec of Kotlin/JS?Robert Jaros
10/25/2025, 6:49 PM2.3.0-Beta1 and trying to @JsExport a class with suspending method. I'm getting Declaration of such kind (suspend function) cannot be exported to JavaScript. error. I thought it had been fixed as https://youtrack.jetbrains.com/projects/KT/issues/KT-56281. Was I wrong?MrPowerGamerBR
10/25/2025, 8:21 PMSeth Madison
10/27/2025, 11:21 PMkotlin.js.get. This is breaking our koin integration.MrPowerGamerBR
10/28/2025, 2:47 AMeval on a project still causes the project's bundle size to shoot up for some unknown reason
I did talk about that bug 1+ year ago here on this channel, but that time I could fix the bug by creating proper typings, but sadly this time I really needed to use eval (executing scripts sent in HTML fragments by the server) https://kotlinlang.slack.com/archives/C0B8L3U69/p1715660256035359
So here's a workaround: Instead of using eval directly, use window.asDynamic().eval(element.innerHTML)
Bundle sizes:
• With eval(element.innerHTML) (from kotlin.js): 1.788KB
• With `window.asDynamic().eval(element.innerHTML)`: 1.030KBSebastien Leclerc Lavallee
10/28/2025, 5:01 AMmoduleA.
I want to have another module that would be able to showcase how to use that moduleA .
I have this right now:
plugins {
kotlin("multiplatform")
}
kotlin {
js {
browser()
}
sourceSets.jsMain.dependencies {
implementation(project(":moduleA"))
}
}
Inside my sample app, I have that index.html where it auto import
<script type="application/javascript" src="sampleApp.js"></script>
that is server by webpack.
How can I access that moduleA from a <script> tag inside the index.html ?
Thanks!Sam
10/29/2025, 9:28 AMjsTest resources directory? No matter what I do I seem to just get a 404
It's a service worker so it needs to be accessible as a static file off the root path
I've tried the following (with absolute path) but still getting a 404
val devServer = (webpackConfig.devServer ?: KotlinWebpackConfig.DevServer())
webpackConfig.devServer = devServer.copy(
static = (devServer.static ?: mutableListOf()).apply {
add("<ABSOLUTE PATH>/>/src/jsTest/resources/")
}
)Nathan Bedell
10/30/2025, 2:08 PMHoratio Thomas
11/02/2025, 9:11 AMEdoardo Luppi
11/03/2025, 6:41 PMexport default of plain objects, I've seen that exporting something like
val obj = js("{}")
Generates something on the line of
var obj = {};
var x = { get: obj };
export default x;
I don't understand the get: part to be honest. I understand getInstance for instances of Kotlin classes/objects, since they can be lazy, but not for JS objects or externals.turansky
11/04/2025, 1:10 PM16.0.0 we use Rolldown by default.
It creates production build 3 times faster in our Kotlin/JS cases (2 min -> 40 sec) 😜
2% bundle reducing - additional bonus.
Both JS and WasmJS targets supported.
Special thanks to @Michael Porotkin