Skip to content
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

[BUG] Exception in thread "main" java.lang.IllegalStateException: No Window for PreCompose, please use ProvidePreComposeLocals in WindowScope to setup your desktop project #408

Open
JagadishaIncture opened this issue Nov 28, 2024 · 2 comments

Comments

@JagadishaIncture
Copy link

JagadishaIncture commented Nov 28, 2024

Exception in thread "main" java.lang.IllegalStateException: No Window for PreCompose, please use ProvidePreComposeLocals in WindowScope to setup your desktop project

Below error while running in desktop
Screenshot 2024-11-28 at 6 50 50 PM

Config

CMP : 1.6.11
Kotlin 2.0.0
Precompose 1.6.2

@JagadishaIncture JagadishaIncture changed the title [BUG] Desktop not running [BUG] Exception in thread "main" java.lang.IllegalStateException: No Window for PreCompose, please use ProvidePreComposeLocals in WindowScope to setup your desktop project Nov 28, 2024
@JagadishaIncture
Copy link
Author

Exception in thread "main" java.lang.IllegalStateException: No Window for PreCompose, please use ProvidePreComposeLocals in WindowScope to setup your desktop project
at moe.tlaster.precompose.PreComposeWindowKt.LocalWindow$lambda$1(PreComposeWindow.kt:78)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at androidx.compose.runtime.LazyValueHolder.getCurrent(ValueHolders.kt:46)
at androidx.compose.runtime.LazyValueHolder.readValue(ValueHolders.kt:48)
at androidx.compose.runtime.CompositionLocalMapKt.read(CompositionLocalMap.kt:91)
at androidx.compose.runtime.ComposerImpl.consume(Composer.kt:2375)
at moe.tlaster.precompose.PreComposeWindowKt.PreComposeApp(PreComposeWindow.kt:162)

@Yanguan619
Copy link

Exception in thread "main" java.lang.IllegalStateException: No Window for PreCompose, please use ProvidePreComposeLocals in WindowScope to setup your desktop project

Below error while running in desktop Screenshot 2024-11-28 at 6 50 50 PM

Config

CMP : 1.6.11 Kotlin 2.0.0 Precompose 1.6.2

exmple for jvmMain:

fun main() = application {
    Window(
        onCloseRequest = ::exitApplication,
        title = "",
    ) {
        ProvidePreComposeLocals {
            App()
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants