question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Forced to add compose runtime to jvmMain when using compose + ktor

See original GitHub issue

The compileKotlinJvm task fails with:

androidx.compose.compiler.plugins.kotlin.IncompatibleComposeRuntimeVersionException: The Compose Compiler requires the Compose Runtime to be on the class path, but none could be found. The compose compiler plugin you are using (version 1.1.0-beta01) expects a minimum runtime version of 1.0.0.

Unless I add implementation(compose.runtime) to jvmMain.dependencies

But this feels weird since I’m only using compose for the js target.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
akurasovcommented, Dec 14, 2021

The issue is that you have single module project and this module contains both server and Js code. You use Compose plugin in this module, so it is used for all sourceSets. Compose plugin forces usage of Compose Compiler plugin, that checks compose runtime presence. So your build scripts uses Compose for server side.

I would suggest to separate Server and JS code into separate modules.

0reactions
akurasovcommented, Dec 21, 2021

I would like to have an example application with different Spring and compose for web modules.

There is no such at the moment, but probably we should create one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compose Runtime - Android Developers
Fundamental components of compose UI needed to interact with the device, including layout, drawing, and input. Declaring dependencies. To add a dependency on ......
Read more >
Kotlin Multiplatform by Tutorials, Chapter 5: Developing UI
This adds the repository for the Compose Multiplatform library. Open the shared build.gradle.kts file and add the following after kotlin -> android():.
Read more >
WhatsNew 2.0 | Ktor Framework
i upload my ktor project to heroku server and succeffly upload and it work only for simple request put when it go inside...
Read more >
Jetpack Compose: Displaying data in compose using MVVM
State import androidx.compose.runtime. ... IO).launch { /* _posts.value is used now due to the datatype change */ _posts.value = KtorClient.
Read more >
Compose for Desktop: Milestone 4 Released | The Kotlin Blog
More desktop UI goodies are coming your way! Milestone 4, the latest version of Compose for Desktop, comes packed with features to help...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found