-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CompositionLocalProvider related RuntimeError: illegal cast #5074
Comments
Ha, I was about to create an issue like this one ! |
A workaround is here #5045 (comment) (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. |
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
![image](https://private-user-images.githubusercontent.com/1074449/346279400-d0e06dba-37bb-40e6-b69e-5c5f657d61b8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExNTMxODEsIm5iZiI6MTcyMTE1Mjg4MSwicGF0aCI6Ii8xMDc0NDQ5LzM0NjI3OTQwMC1kMGUwNmRiYS0zN2JiLTQwZTYtYjY5ZS01YzVmNjU3ZDYxYjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTZUMTgwMTIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDZhZDJlOWU4ODc3Y2IzZTUzMWI1NzMxN2MyNjA5ZDY0OTZlMDVkMzhiOWNjMmEyNDg0NzBkZjg0YmU2NTE0MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.0FdpKWSulqjhNfkTIal5_7j8imJAqXR58RAd0_O0bfg)
From the browser console:
The text was updated successfully, but these errors were encountered: