I'm trying to run my compose project on web. I get...
# compose-web
s
I'm trying to run my compose project on web. I get this error screen on both JS and WASM targets while on it runs successfully on other targets. The only change I made was upgrading compose dependency to 1.6.0-beta2.
o
what was the previous version? before you updated to 1.6.0-beta2 could you please share the project?
s
Sure, here's the GitHub repo. Check out the wasm branch. https://github.com/ShreyashKore/wonderous_compose The previous compose version was 1.5.11 (vs 1.6.0-beta02 in wasm branch) The JS target from the main branch runs perfectly but in the wasm branch it gives above error.
Copy code
Function 'attachTo' can not be called: No function found for symbol 'org.jetbrains.skiko/SkiaLayer.attachTo|attachTo(org.w3c.dom.HTMLCanvasElement;kotlin.Boolean){}[0]'
IrLinkageError: Function 'attachTo' can not be called: No function found for symbol 'org.jetbrains.skiko/SkiaLayer.attachTo|attachTo(org.w3c.dom.HTMLCanvasElement;kotlin.Boolean){}[0]'
    at throwLinkageError (webpack-internal:///./kotlin/kotlin-kotlin-stdlib.js:6856:11)
    at new ComposeWindow (webpack-internal:///./kotlin/compose-multiplatform-core-compose-ui-ui.js:44093:5)
    at CanvasBasedWindow (webpack-internal:///./kotlin/compose-multiplatform-core-compose-ui-ui.js:43947:24)
    at main$lambda (webpack-internal:///./kotlin/WonderousCompose-composeApp.js:23740:5)
While wasmJs target refuses to build with the following error:
Copy code
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':composeApp:compileDevelopmentExecutableKotlinWasmJs'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:148)
Let me know if u need more info. Thanks.
🙏 1
o
Beautiful app! I see it was initially made using flutter. Great job porting it to Compose! 🙌 It works for me if I add these changes in wasm branch:
Copy code
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml	(revision 96d02aa61efd6754c84c003c012e1908f643705d)
+++ b/gradle/libs.versions.toml	(date 1708014757796)
@@ -9,9 +9,9 @@
 androidx-espresso-core = "3.5.1"
 androidx-material = "1.11.0"
 androidx-test-junit = "1.1.5"
-coilCompose = "3.0.0-SNAPSHOT"
-compose = "1.6.0-beta02"
-compose-plugin = "1.6.0-beta02"
+coilCompose = "3.0.0-alpha03"
+compose = "1.6.0-rc01"
+compose-plugin = "1.6.0-rc01"
 junit = "4.13.2"
 kotlin = "1.9.21"
 accompanistPermissions = "0.29.2-rc"
Also I had to disable wasmJs target for now, because I didn't find a version of coil that supports it already. Note: newer coil versions depend on compose multiplatform 1.5.11 which is not compatible with 1.6.0-... builds for web targets.
s
Thank you 😄. Been working on this project for quite few months now. Hope this brings more attention to the amazing tech you guys are building. If you have any feedback I would love to hear that.
1
183 Views