https://kotlinlang.org logo
#webassembly
Title
# webassembly
a

Alexander Girke

02/24/2023, 8:14 AM
Hey, I tried to run https://github.com/linux-china/kotlin-wasm-node-demo after changing the version to
1.8.20-Beta
, but was not able to. Basically, the command
~/.gradle/nodejs/node-v19.6.0-darwin-x64/bin/node --experimental-wasm-gc ~/kotlin-wasm-node-demo/build/js/packages/kotlin-wasm-node-example-wasm/kotlin/kotlin-wasm-node-example-wasm.mjs
failed with the following error message:
Copy code
file://~/build/js/packages/kotlin-wasm-node-example-wasm/kotlin/kotlin-wasm-node-example-wasm.uninstantiated.mjs:140
        const wasmModule = new WebAssembly.Module(wasmBuffer);
                           ^

CompileError: WebAssembly.Module(): Compiling function #16:"kotlin.collections.IteratorImpl.hasNext" failed: i32.trunc_f64_s[0] expected type f64, found call_ref of type i32 @+14179
    at instantiate (file://~/kotlin-wasm-node-demo/build/js/packages/kotlin-wasm-node-example-wasm/kotlin/kotlin-wasm-node-example-wasm.uninstantiated.mjs:140:28)
    at async file://~/kotlin-wasm-node-demo/build/js/packages/kotlin-wasm-node-example-wasm/kotlin/kotlin-wasm-node-example-wasm.mjs:3:17
Is this a known issue?
s

Svyatoslav Kuzmich [JB]

02/24/2023, 8:16 AM
Hey, can you try it with v20.0.0-v8-canary202212266b2b946a63 as described in https://github.com/sdeleuze/kowasm#node?
This error could mean that V8 is too old, or it could be an unknown to us bug otherwise
a

Alexander Girke

02/24/2023, 8:21 AM
Thanks for the fast response, the latest node version did the trick indeed 👍
2 Views