https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

Arjan van Wieringen

11/02/2023, 2:51 PM
With Kotlin 1.9.20 we're getting gradle issues:
Copy code
java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBrowserDsl.commonWebpackConfig(kotlin.jvm.functions.Function1)'
	at Build_gradle$2$1$1.invoke(build.gradle.kts:19)
	at Build_gradle$2$1$1.invoke(build.gradle.kts:18)
Copy code
js(IR) {
        browser {
            commonWebpackConfig {
                cssSupport {
                    enabled.set(true)
                }
            }
        }
        binaries.executable()
    }
a

Anton Lakotka [JB]

11/02/2023, 4:50 PM
cc: @Ilya Goncharov [JB]
a

Arjan van Wieringen

11/02/2023, 5:05 PM
We tried different Gradle versions as well, but to no avail
a

atyrin

11/02/2023, 5:26 PM
Is the code located in the buildSrc or some convention plugin? It looks similar to the issue. And probably the way to fix it is using
kotlin-dsl
plugin that will generate required accessors or wrap the commonWebpackConfig body in
Action()
a

Arjan van Wieringen

11/02/2023, 7:50 PM
No it is not in a buildsrc. I’ll check if we need to use Action
v

Vaibhav

11/02/2023, 8:32 PM
We are also facing the same issue After updating to kotlin version 1.9.10 from 1.8.20
Copy code
js(IR) {
    browser {
        commonWebpackConfig(Action {
            cssSupport {
                enabled.set(true)
            }
        })
    }
}
> Task :plugin-build:tailwind-kt:compileKotlin FAILED
3 actionable tasks: 1 executed, 2 up-to-date
e: file:///C:/Users/kizzy/IdeaProjects/tailwind-kt/plugin-build/tailwind-kt/src/main/kotlin/kizzy/tailwind/utils/SetupTailwindProject.kt:14:17 Unresolved reference: cssSupport
e: file:///C:/Users/kizzy/IdeaProjects/tailwind-kt/plugin-build/tailwind-kt/src/main/kotlin/kizzy/tailwind/utils/SetupTailwindProject.kt:15:21 Unresolved reference: enabled
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':plugin-build:tailwind-kt:compileKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
BUILD FAILED in 1s
a

Arjan van Wieringen

11/03/2023, 2:06 PM
This works:
Copy code
webpackTask(Action {
                cssSupport(Action {
                    enabled.set(true)
                })
            })
This doesn't:
Copy code
webpackTask(body = {
                cssSupport(action = {
                    enabled.set(true)
                })
            })
So it is related to the SAM convention
Gradle is weird
v

Vaibhav

11/03/2023, 5:46 PM
That also doesnt seem to work for us
a

Arjan van Wieringen

11/03/2023, 8:40 PM
The same issue is in the tailwind plugin which should have been updated by now
i

Ilya Goncharov [JB]

11/04/2023, 9:18 AM
Please be sure that if you use it in developing of standalone Gradle plugin, it has
kotlin-dsl
plugin applied. From my side, I'll take a look, and possibly it is useful to return back lamda-based dsl functions
v

Vaibhav

11/14/2023, 4:16 AM
@Arjan van Wieringen the issue in the tailwind-kt plugin(if you are talking about that) is fixed now , you can use 0.0.4
a

Arjan van Wieringen

11/14/2023, 6:33 AM
@Vaibhav I know because I create the PR for the fix 😂
v

Vaibhav

11/14/2023, 10:15 AM
Oh, thanks for making the pr 🥰
4 Views