Has anyone had any success in declaring wasm suppo...
# compose-web
z
Has anyone had any success in declaring wasm support in multiple modules, then consuming & running them in a web app?
👀 1
I can get the wizard generated project to run just fine, but as soon as I try to introduce multiple modules with wasm....
Copy code
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)
Library modules:
Copy code
wasmJs {
    moduleName = project.name
    browser()
    binaries.executable()
}
Web app module:
Copy code
wasmJs {
    moduleName = "composeApp"
    browser {
        commonWebpackConfig {
            outputFileName = "composeApp.js"
        }
    }
    binaries.executable()
}
Copy code
compose.experimental {
    web.application { }
}
Ultimately I dont know how/why but it now works 🤷🏽‍♂️ I previously had my catalog of components in a module called "showcase" which depends on a bunch of my design system modules, and I would run it from my "sample" module targeting desktop, ios, wasm, etc. I just moved everything from my showcase module to my sample module (realizing that having both was not necessary too) and it works with the exact same setup. Not sure if thats a bug, if anyone wants me to report it, let me know!
o
in the library module you don't need
binaries.executable()
not sure if it's the cause though. binaries.executable() creates the gradle tasks to run the app. But in the library module there's likely no fun main()
z
It works just the same with/without
binaries.executable()
but makes sense that I shouldnt include it for my library modules. I noticed that I accidentally ran one of my modules instead of my "main" module yesterday due to this (not related to the issue I was having today though). My module looks exactly like the one that was causing issues earlier on, but runs perfectly fine now 👍🏽
👍 1
k
idk if you ever figured this out but im having this same issue and cant figure out what is causing it... was working the other day just fine 😄
2
r
Got exactly the same. For me the issue was, to forget starting koin.
209 Views