JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.15k stars 1.17k forks source link

Previewing fails with AssertionError: Data is too big #5099

Closed rand0m-cloud closed 3 months ago

rand0m-cloud commented 3 months ago

I am getting this error while trying to preview a screen in desktopMain. This has not been an issue until today for some reason.

@Preview
@Composable
fun TestPreview() {
    Text("preview")
}
java.lang.AssertionError: Data is too big: 1802136077 >= 8192
    at org.jetbrains.compose.desktop.ui.tooling.preview.rpc.RemoteConnectionImpl.readData(RemoteConnection.kt:139)
    at org.jetbrains.compose.desktop.ui.tooling.preview.rpc.RemoteConnectionImpl.receiveCommand(RemoteConnection.kt:87)
    at org.jetbrains.compose.desktop.ui.tooling.preview.rpc.CommandsKt.receiveConfigFromGradle(commands.kt:89)
    at org.jetbrains.compose.desktop.ui.tooling.preview.rpc.PreviewManagerImpl$special$$inlined$repeatWhileAliveThread$default$4.invoke(PreviewManager.kt:312)
    at org.jetbrains.compose.desktop.ui.tooling.preview.rpc.PreviewManagerImpl$special$$inlined$repeatWhileAliveThread$default$4.invoke(PreviewManager.kt:283)
    at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)

I think it is this line that needs to be increased: https://github.com/JetBrains/compose-multiplatform/blob/9a9602d10f57122fb6b2fd8c1937bb512b9a58ae/gradle-plugins/preview-rpc/src/main/kotlin/org/jetbrains/compose/desktop/ui/tooling/preview/rpc/constants.kt#L10

The captured dump of previewing cap.txt

igordmn commented 3 months ago

Please, create issues in YouTrack https://github.com/JetBrains/compose-multiplatform/issues/5102

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.