With the Compose 1.7.0-alpha01 release, I’m seeing...
# compose-web
c
With the Compose 1.7.0-alpha01 release, I’m seeing Compose for Web HTML broken in some weird ways. For example, this will crash:
Copy code
org.jetbrains.compose.web.dom.Div {
        org.jetbrains.compose.web.dom.Button(attrs = {
            onClick {
                action()
            }
        }) {
            org.jetbrains.compose.web.dom.Text("Let's Start!")
        }
    }
The exception is:
Copy code
TypeError: e is not a function
at Hi (Base.kt:140:13)
at nr (Elements.kt:497:5)
at ns (Intro.kt:42:5)
at us (MainView.kt:136:34)
at as (MainView.kt:114:13)
at os (MainView.kt:65:13)
at Sr (App.kt:28:5)
at ft (Entrypoint.kt:93:21)
at sn.r7q (ComposableLambda.jb.kt:107:22)
at fa2_1 (Entrypoint.kt:92:19)
In terms of isolating it, either of these changes make the crash go away: • The onClick attr is removed • The outer Div is removed Is Compose 1.7.0-alpha01 just broken, or were there some API. changes I should be accounting for?
r
I've just posted a question about 1.7.0-alpha01 regarding my own compose based framework. I think it could be related.
i
Thanks for the report. We are working on it in https://youtrack.jetbrains.com/issue/CMP-1612/Uncaught-TypeError-content-is-not-a-function and https://youtrack.jetbrains.com/issue/CMP-1603/Navigation-Wasm-Error-illegal-cast Workaround: use Kotlin 1.9.22 or 2.0.10-RC-510 (available with
maven("<https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/>")
)
🙌 1
p
Can confirm 2.0.10-RC-510 fixes the issue at least in Compose Web Wasm