http://kotlinlang.org logo
Join Slack
Powered by
# webassembly
  • m

    Michael Paus

    09/20/2025, 3:28 PM
    Wasm 3.0 has been released http://webassembly.org/news/2025-09-17-wasm-3.0/ What does that mean for Kotlin/Wasm?
    🎉 5
    .wasm 4
    👀 8
    c
    • 2
    • 1
  • a

    Adolfo Ochagavía

    09/20/2025, 4:18 PM
    Is it currently possible / supported to compile a library as a wasm module, similar to how kotlin native compiles to a shared library? The Kotlin/Wasm docs seem to focus on executables and I haven't managed to adapt those examples to my library use case. For context, my use case is the following: I created a library in kotlin multiplatform, compiled it as a native shared library, created an idiomatic Python wrapper around the shared library's low-level functions, and published it to pip. One drawback I'd like to get rid of is the necessity to build and publish multiple artifacts, one per platform, because shared libraries are platform dependent. The easiest solution (as far as I can see) is to compile my library to wasm, which is platform independent, and ship that instead of a native shared library.
    k
    • 2
    • 6
  • a

    Adolfo Ochagavía

    09/22/2025, 12:37 PM
    (In case this is not supported yet, I'd be also interested in hearing about if there's interest in such a feature from the kotlin maintainers)
    a
    • 2
    • 1
  • a

    Andrey Yegorov

    09/23/2025, 5:13 AM
    I love kmp wasm but there is one annoying thing - texts on buttons are loading not instantly and with weird animations. Is that going to be fixed? 😅 See example in thread.
    w
    g
    p
    • 4
    • 10
  • v

    Vladyslav

    09/25/2025, 1:13 PM
    Hi Kotlin developers, I need your advice. I want to be able to compile clean WebAssembly (
    wasm32-unknown-unknown
    ) from Kotlin code. Even if this means giving up some language constructs and features, I still want to achieve it. Could you help me understand the best way to do this?
    c
    • 2
    • 4
  • s

    Seth Madison

    09/26/2025, 3:07 PM
    Is there a runtime (native) that supports wasmgc? My cursory googling turned up nothing.
    e
    m
    g
    • 4
    • 5
  • o

    Oliver.O

    09/30/2025, 12:03 PM
    Is this example still state of the art for accessing environment variables in WASI?
  • m

    martmists

    10/01/2025, 11:44 PM
    For some reason my wasm app started throwing
    Copy code
    Module not found: Error: Can't resolve './skiko.mjs' in '/path/build/wasm/packages/project-name/kotlin'
    but it worked fine a few days ago, any ideas what could be causing this? The only things that really come to mind are that I've added Coil3 and Skydoves ColorPicker Is the file available for download anywhere perhaps?
  • o

    O'Shane McKenzie

    10/02/2025, 5:31 AM
    Copy code
    fun testFun(){
        val chars = CharArray(7)
    }
    Cannot access 'Cloneable' which is a supertype of 'CharArray'. This may be forbidden soon. Check the module classpath for missing or conflicting dependencies. I am getting the above error, and I cannot figure out why. it only happens in webMain or commonMain if i add it.
    r
    e
    • 3
    • 5
  • p

    Piotr Krzemiński

    10/02/2025, 8:48 AM
    I'm trying to have such a function in Wasm target (it works fine for other targets):
    Copy code
    internal actual fun isInteger(value: Any): Boolean =
        js("return Number.isInteger(value)")
    but I'm getting
    Type 'Any' cannot be used as value parameter type of JS interop function. Only external, primitive, string, and function types are supported in Kotlin/Wasm JS interop.
    . Tried also with
    Number
    as the arg type. Is there an idiomatic way of dealing with these? Maybe even the function's body can be implemented in a better way, but first I need to sort out the function's signature being invalid
    r
    c
    t
    • 4
    • 23
  • c

    chrisjenx

    10/04/2025, 4:52 AM
    I'm guessing it's a know issue tab/accessibility/autofill/password managers don't seem to work correctly on wasmJs yet? If they do what am I missing, got semantics added/ime types etc? If not I'm hoping they are high on the fix list as wasmJs is beta now?
    t
    v
    o
    • 4
    • 12
  • e

    edwinRNDR

    10/06/2025, 5:29 PM
    Since wasmJs doesn't have @EagerInitialization, what are other ways to ways to run code when a module is loaded. I am looking for something where components register themselves to a component registry.
    o
    • 2
    • 2
  • p

    Pavel Kazlovich

    10/08/2025, 8:04 AM
    Is there a way to check if some value is of JsAny type? Naive
    is JsAny
    makes the compiler angry since it's an external type. My use case is writing a simple idempotent Any->JsAny converter which accepts primitives, iterables, maps and JsAny and gets me back JsAny or throws an error.
    r
    • 2
    • 4
  • k

    Konstantinos Lountzis

    10/11/2025, 10:38 PM
    More of a discussion prompt than an actual question: I was wondering about external links on "regular" html/js/css websites and how when you hover them you actually see the destination of that link on the bottom corner of the browser. Now with Compose Multiplatform Wasm I can have a clickable
    Text
    that calls a
    UriHandler
    and this browser link is never previewed on hover. As a user interacting with a website I feel that it could be a sort of a security feature missing here, so I am wondering if there is a way to pass this hint to the browser. But also it seems like it can either way be easy to override by devs to display whatever. Has anyone else had any thoughts about this one? I also realize it is not a Compose Multiplatform issue per se but the fact that we are rendering on a Canvas?
    👍 3
    g
    • 2
    • 8
  • o

    O'Shane McKenzie

    10/13/2025, 2:04 AM
    I have a question, which I think I should have known the answer to at this point. When I plan to develop using Kwasm, I only select the web option in the wizard, so I never really had a use for the commonMain src set. Back when Kwasm was in alpha, the entry point was in wasmaJsMain. Now it is in webMain. But I am now having a challenge accessing code that I write in wasmJsMain in web main. For instance, I wrote a custom navigation class that essentially listens for back and forward browser events and intercepts them. Long story short, I am able to show different "pages" based on a manual page state and navigate to them, etc., but this only works in wasmJsMain since it makes use of certain browser APIs, among other things, that are not accessible in webMain for some reason. My question is how can I access these functions, classes, etc., in wasmJsMain from webMain, or can I switch the entry point back to wasmJsMain?
    o
    c
    • 3
    • 4
  • c

    CLOVIS

    10/15/2025, 3:18 PM
    What's the currently recommended approach with lock files? I get
    Copy code
    * What went wrong:
    Execution failed for task ':kotlinWasmStorePackageLock'.
    > Lock file was changed. Run the `kotlinWasmUpgradePackageLock` task to actualize lock file
    all the time. Sometimes, I have to run
    kotlinWasmUpgradePackageLock
    twice for it to disappear. Sometimes, I run tests and then I have to do it again. How are you dealing with this?
    ➕ 3
    t
    o
    c
    • 4
    • 22
  • m

    Mario Andhika

    10/17/2025, 2:33 AM
    Anyone know a Compose Wasm library to create a sharing popup like Android’s intent?
    plus one 1
  • m

    Mario Andhika

    10/17/2025, 12:04 PM
    What options are recommended to maximize compatibility with Safari?
    m
    • 2
    • 3
  • s

    Seth Madison

    10/17/2025, 5:17 PM
    Now that wasm-js is in beta is there a chance that folks may pick up wasm-wasi again?
  • j

    joseph_ivie

    10/18/2025, 7:06 AM
    What's the status of Kotlin in regards to the Component Model and WIT bindings / WASI 0.2 (Preview 2)? I have an idea brewing that would be really slick but it absolutely requires the new stuff.
    👀 5
  • l

    louiscad

    10/21/2025, 8:00 AM
    Hello, is anyone using SqlDelight on WASM? Support has been added in this PR about a year ago: http://github.com/sqldelight/sqldelight/pull/5534 But the PR to document it even the slightest is sadly still open, heavily limiting discoverability: http://github.com/sqldelight/sqldelight/issues/5845
    m
    a
    • 3
    • 2
  • a

    AndrewStone

    10/23/2025, 4:42 PM
    If you have compiler-crashing problems, like this:
    Copy code
    java.lang.NullPointerException: null cannot be cast to non-null type org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
    This slack convo solved them for me: http://slack-chats.kotlinlang.org/t/27045384/hi-there-i-have-a-very-annoying-internal-compiler-error-here#0a1d5745-d31d-4c97-9a1d-92cabe33fe88 Basically, put mavenLocal() at the end of your repo source list, and delete ~/.m2 -- your machine has cached old libs. I'm repeating it here because the visibility of this solve is low, and this problem hit me moving up to 2.2.20.
  • j

    jean

    10/23/2025, 9:07 PM
    Hi! I heard in a lightning talk from the Kotlin Conf 2025 that Compose Multiplatform on Web (with Wasm) is rendered on Canvas. How does that work? Are there any resources diving into rendering? I have a bunch of questions like • Does it write ui updates as bytes into a shared memory and the web browser reads from it as a stream and sends that to the canvas? • Does it calculate/render the compose tree and send that over the browser where it converts it as UI?
    c
    a
    p
    • 4
    • 13
  • r

    Robert Jaros

    10/25/2025, 4:18 PM
    Testing 2.3.0-Beta1. Is there something I can do about
    Opt-in requirement marker kotlin.js.ExperimentalWasmJsInterop is unresolved. Please make sure it's present in the module dependencies
    when applying the opt-in in a
    buildSrc
    for all modules?
    t
    • 2
    • 6
  • c

    Clarke

    10/28/2025, 8:01 PM
    whats the etiquette on "annoying but not crippling" bugs? e.g. Gradle task to compile wasm that just changes types generate by
    generateTypeScriptDefinitions()
    but not the binary wasm doesn't rebuild the types. • github issue? • github PR with broken test to expose it? • youtrack issue? • just ignore it because fixing it is almost undoubtedly worse right now than it being an issue?
    youtrack 2
    👍 1
    • 1
    • 1
  • r

    Robert Jaros

    10/29/2025, 4:27 PM
    Starting with
    2.3.0-Beta2
    , when building my project inside docker using
    gradle:9.1.0-jdk21
    image I have this error:
    kotlinWasmNpmInstallnode: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
    . What could be wrong?
    • 1
    • 3
  • m

    Mario Andhika

    10/31/2025, 9:03 AM
    Anyone know why this works on Chrome but not on Safari?
    Copy code
    val scope = rememberCoroutineScope()
    val uriHandler = LocalUriHandler.current
    Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center) {
        Button({
            scope.launch {
                viewModel.upgradeCommunity()?.let { url ->
                    uriHandler.openUri(url)
                }
            }
        }) {
            Text("Subscribe")
        }
    }
    On Safari it won’t open the Url. I’ve checked that the url is correct
    c
    • 2
    • 2
  • t

    turansky

    11/04/2025, 1:14 PM
    http://kotlinlang.slack.com/archives/C0B8L3U69/p1762261830446839
  • s

    Slackbot

    11/06/2025, 5:04 AM
    This message was deleted.
    r
    • 2
    • 3
  • s

    Slackbot

    11/09/2025, 4:22 PM
    This message was deleted.
    j
    m
    • 3
    • 2