I am developing an application using Kotlin and Compose Multiplatform. The Android and iOS versions work correctly, but the web application displays a blank screen.
Here is the content of Main.kt inside the jsMain source set:
@OptIn(ExperimentalComposeUiApi::class)
fun main() {
CanvasBasedWindow("Test") {
Surface(modifier = Modifier.fillMaxSize()) {
App(koin)
}
}
}
When running the app in the browser, I get a blank screen and the following exception in the console:
ClassCastException at line "throw e" in Test.js
Relevant snippet from the browser console:
/******/ var __webpack_module_cache__ = {};
/******/ function __webpack_require__(moduleId) {
var cachedModule = __webpack_module_cache__[moduleId];
if (cachedModule !== undefined) {
if (cachedModule.error !== undefined) throw cachedModule.error;
return cachedModule.exports;
}
var module = __webpack_module_cache__[moduleId] = { exports: {} };
try {
var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: __webpack_require__ };
__webpack_require__.i.forEach(function(handler) { handler(execOptions); });
module = execOptions.module;
execOptions.factory.call(module.exports, module, module.exports, execOptions.require);
} catch(e) {
module.error = e;
throw e;
}
}
How can I resolve this issue? Any suggestions or guidance would be appreciated!