I'm developing a Kotlin Multiplatform (KMP) project using JetBrains Compose Multiplatform, targeting Android, Desktop, iOS, and WebAssembly (wasmJs).
In composeApp/src/wasmJsMain/kotlin/org/example/learnkenyang/main.kt for the web target, I used the following code:
@OptIn(ExperimentalComposeUiApi::class)
fun main() {
ComposeViewport(viewportContainerId = "composeApplication") {
App()
}
}
However, when I tried to run the Web (wasm) version, I got this runtime error in the browser console:
Uncaught runtime errors: × ERROR
[object WebAssembly.Exception] at handleError (webpack-internal:///../../node_modules/webpack-dev-server/client/overlay.js:252:58) at eval (webpack-internal:///../../node_modules/webpack-dev-server/client/overlay.js:275:7)