Hi, I'm using KMP to build the new version of https://github.com/unit-mesh/auto-dev . Now I had a question about use WASM in Kotlin. I try to use @JSModule but no working:
JsException: Exception was thrown while running JavaScript code
I don't know how to debug so changes to @JSFun
Copy code
/**
* Not working
*/
@JsModule("web-tree-sitter")
external object ParserModule : JsAny {
fun init(): Promise<JsAny>
}
/**
* Final version
*/
@JsFun("async () => { const ts = await import('web-tree-sitter'); await ts.default.init(); return ts.default; }")
external fun initTreeSitter(): Promise<TreeSitterModule>
I want to now for Web version, is its will cause performance issue to use JSFun? Or maybe have better way?
t
tapchicoma
11/14/2025, 11:03 AM
cc @bashor
🙏 1
b
bashor
11/14/2025, 1:18 PM
With Kotlin 2.2.20+ you should get more actionable exception