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.

Gradle configuration error: Cannot add extension with name 'kotlinNodeJs'

See original GitHub issue

In multiplatform project which is also muiltiproject: as soon as I add id 'kotlinx-serialization' version '1.3.40' to plugins of one of subprojects, gradle can no longer configure other subprojects and fails with the following error:

Cannot add extension with name ‘kotlinNodeJs’, as there is an extension already registered with that name.

Environment

  • Kotlin version: 1.3.40
  • Kotlin platforms: Multiplatform
  • Gradle version: 4.10.3

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
eugenio1590commented, Jul 24, 2020

I was able to replicate the problem. The issue occurs when I include a Kotlin multi-platform project with browser support in another that uses “kotlinx.serialization” library. I will create a project with that problem later.

1reaction
eugenio1590commented, Jul 23, 2020

I get this issue when I try to apply the plugin into a Kotlin JS project for browsers. This is the complete error:

Could not create an instance of type org.jetbrains.kotlin.gradle.targets.js.subtargets.KotlinBrowserJs.
> Failed to apply plugin [class 'org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin']
   > Cannot add extension with name 'kotlinNodeJs', as there is an extension already registered with that name.

I am using these plugins:

plugins {
    id("org.jetbrains.kotlin.js") version "1.3.72"
    kotlin("plugin.serialization") version "1.3.72"
}

I tried to use (apply false) but this did not work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot add extension with name 'kotlin', as there is an ...
In build.gradle we were using it like : apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions'. In build.gradle.kts it ...
Read more >
Set up a Kotlin/JS project
js Gradle plugin that provides project configuration tools together with helper tasks for automating routines typical for JavaScript development ...
Read more >
Gradle error: Cannot add extension with name 'sonarRunner ...
When project B depends on project A and we invoke project A's build from project B using the "settings.gradle" mechanism.
Read more >
Running on Apple M1 - Installation and setup - OPENRNDR
I saw that there had been no movement on this issue (Feature request: ... add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.
Read more >
Disabling Node.js download in KotlinJS Gradle plugin-kotlin
The NodeJsRoot plugin applies itself, which causes the NodeJsRootExtension to be included under the name kotlinNodeJs . Thus, I believe, any of the...
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