Closed bnorm closed 2 months ago
Ha, I was about to create an issue like this one !
I confirm that this is happening in compose 1.7.0-alpha01
. Because I had about the same stacktrace and it was fixed only by downgrading to compose 1.6.11
!!!
In my case the CompositionLocalProvider
that crashed was something related to Surface
from Material3
, also tried to downgrade to Surface
from Material
i.e. Material 2.
A workaround is here https://github.com/JetBrains/compose-multiplatform/issues/5045#issuecomment-2210683603 (my problem was with Surface Material 3)
Hi @bnorm! Thanks for reporting!
Indeed, 1.7.0-dev and alpha (and all furter builds) won't work in web with kotlin 2.0.0, because the compose compiler for web for 2.0.0 doesn't support a new API added in compose runtime 1.7.0
For now, you can use kotlin:
The fix can't be backported to 2.0.0, it will be available only in kotlin 2.0.10.
I'm closing this one as I see no particular actions on our side, except suggesting to use a correct Kotlin version. Feel free to add more questions or reopen if needed.
I can confirm that version 2.0.10-RC-515 does indeed my issue. Thanks!
I did test this with 2.0.20-Beta1 and the issue was present there. I'm guessing the issue will be fixed in the next 2.0.20 release as well?
Yes, the fix was implemented a bit a later than 2.0.20-Beta1.
2.0.20-Beta2 should have it.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Describe the bug
It seems that a CompositionLocalProvider nested within another CompositionLocalProvider is causing a crash on K/Wasm.
MaterialTheme
s does not trigger crash, not sure why. Maybe because it's from a library?CompositionLocalProvider(LocalString provides "test")
andCompositionLocalProvider(LocalInt provides 1)
would also cause the same crash.Affected platforms
Versions
To Reproduce Sample project using https://kmp.jetbrains.com/ : ComposeWasmCrash.zip
Expected behavior App to load and "Hello, World!" to be displayed.
Screenshots
From the browser console: