Hello, This import : ```import org.jetbrains.comp...
# compose-web
r
Hello, This import :
Copy code
import org.jetbrains.compose.web.renderComposable
fails with this error :
Copy code
Unresolved reference: jetbrains
With versions : • Compose 1.4.3 • Kotlin 1.9.0 (marked as compatible here) Would anyone happen to have any leads ?
b
What targets do you have declared, which sourceSet did you add the desktop dependencies at, which sourceSet is the code from?
c
@Big Chungus This error appears in the main function of the web module. That module only has JS enabled. Other modules in the project have compose desktop and compose android.
b
Are you able to share the buildfile of web module?
b
I can't find compose.html.core dependency in any of your modules. That's what provides the missing import.
c
Is that a new change? This happened while upgrading from Compose MPP 1.4.1 to 1.4.3, it worked previously
b
It's not new, but I don't see how you can get that fun without the core dependency
c
The web dependencies are declared in
:styles:style-material-tailwind
b
Is it just red in IDE or gradle is failing too?
c
Gradle is failing too
b
Aha! Two things pop to mind: 1. Compose dependencies are declared as implementation and not api so your demo module does not get them exposed transitively 2. Kotlin.js plugin was deprecated in 1.8.22 so the support for it might've degraded with 1.9.0. Try switching to kmp plugin instead.
c
Thanks, I'll check both of these
i
Compose dependencies are declared as implementation and not api
Yes, in https://gitlab.com/RBD-4SH/decouple/-/blame/d3da609a9e69dbf07351f59d785faa5703a5e46b/style/material-tailwind/build.gradle.kts#L23 it should be:
Copy code
api(compose.web.core)
	api(compose.web.svg)
if you want Compose to be accessible from another module There was a bug in Kotlin JS <= 1.8.22 that allowed to use libraries declared as
implementation
. This bug is fixed in Kotlin 1.9, so you see this compilations error.
c
1. Kotlin.js plugin was deprecated in 1.8.22 so the support for it might've degraded with 1.9.0. Try switching to kmp plugin instead.
Wasn't that, but well, it was a good occasion to migrate.
@Igor Demin
compose.web.core
is marked as deprecated in favor of
compose.html.core
, I assume it makes no difference w.r.t. your comment?
Replacing both by
api
doesn't seem to make a difference
r
m
Hey all, thought I’d share I ran into a similar issue caused by upgrading to Kotlin 1.9.0. My shared / common module used
implementation
instead of
api
for all the Compose libraries. Because of the bug referenced above, my project’s jsApp module had access to all the Compose libraries had access to Compose libraries because the common / shared module was a dependency. After the upgrade, all the Compose references were broken in the jsApp module but a change from
implementation
to
api
in common fixed it.