Can't update multiplatform project (kotlin jvm + k...
# eap
a
Can't update multiplatform project (kotlin jvm + kotlin js), because of NodeJsRootPlugin
Copy code
Failed to apply plugin class 'org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin'.
> Could not create an instance of type org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension.
   > IdeaSyncDetectorVariantFactory type is not known for plugin variants
✔️ 1
t
make sure all KGP plugins are the same version
a
kgp?
t
Kotlin Gradle Plugins
a
Yes it is, I use single point to define versions
Copy code
val kotlinVersion = tools.versions.kotlin

kotlin("jvm") version kotlinVersion apply false
kotlin("plugin.serialization") version kotlinVersion apply false
t
could you share the build scan then?
a
is it because some libraries doesn't update their deps?
t
investigating right now, will come back later with answer
looks like a bug - could you open a YT issue? If possible with repro project
a
this bug appears from time to time, from version to version 🙂
ok, I will try to create a repro project
t
IdeaSyncDetectorVariantFactory
was added only in 1.8.0 🙂
a
I remember similar bug with NodeJsPlugin after update from 1.5 to alpha 1.6
t
Generally
NodeJsPlugin
is far from to be ideal 😒
a
yeah
a
Are you applying
NodeJsRootPlugin
to perform some configuration in root
build.gradle.kts
? Could you please try to replace it with
Copy code
plugins.withType<NodeJsRootPlugin> {
    // configuration
}
?
a
@Alexander.Likhachev I need to set nodejs version Now
Copy code
NodeJsRootPlugin.apply(rootProject).nodeVersion = tools.versions.nodejs.get()
I can't setup version in
Copy code
plugins.withType<NodeJsRootPlugin>
may be there is another option to set version?
after apply I get NodeJsRootExtension, then set verision
a
The following code should work:
Copy code
plugins.withType<NodeJsRootPlugin> {
    the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().nodeVersion = tools.versions.nodejs.get()
}
a
oh, right, it works, thank you!