fcosta
01/22/2020, 12:20 AM> Task :frontend:compileKotlinJs FAILED
w: Module "kotlin-react-dom" is defined in more than one file
w: Module "kotlin-react-router-dom" is defined in more than one file
w: Module "kotlin-react" is defined in more than one file
w: Module "kotlin-extensions" is defined in more than one file
w: Module "kotlinx-html-js" is defined in more than one file
e: warnings found and -Werror specified
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':frontend:compileKotlinJs'.
> Compilation error. See log for more details
Any idea how can I debug this error or disable the warnings? I will write the build.gradle
in the threadfcosta
01/22/2020, 12:20 AMgroup 'com.github.felipehjcosta'
version '1.0-SNAPSHOT'
apply plugin: "org.jetbrains.kotlin.js"
apply plugin: 'kotlin-dce-js'
repositories {
maven { url "<https://kotlin.bintray.com/kotlin-js-wrappers/>" }
}
kotlin {
target {
browser {
configure([compilations.main, compilations.test]) {
kotlinOptions {
metaInfo = true
sourceMap = true
moduleKind = 'commonjs'
main = "call"
allWarningsAsErrors = true
}
}
webpackTask {
runTask {
//todo: use dsl after KT-32016 will be fixed
devServer = new org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig.DevServer(
true, false, true, true, false,
8081,
["/api": "<http://0.0.0.0:8082>"],
["$projectDir/src/main/resources".toString()]
)
outputFileName = "chatapp-frontend.js"
}
}
testTask {
useKarma {
usePhantomJS()
}
}
}
}
sourceSets {
main {
kotlin.srcDirs += 'src/main/kotlin'
dependencies {
implementation project(":common:client")
implementation kotlin("stdlib-js")
implementation "org.jetbrains:kotlin-react:16.9.0-pre.89-kotlin-1.3.60"
implementation "org.jetbrains:kotlin-react-dom:16.9.0-pre.89-kotlin-1.3.60"
implementation "org.jetbrains:kotlin-react-router-dom:4.3.1-pre.89-kotlin-1.3.60"
implementation "org.jetbrains:kotlin-extensions:1.0.1-pre.89-kotlin-1.3.60"
implementation npm("kotlinx-html", "0.6.12")
implementation npm("@jetbrains/kotlin-react", "16.9.0-pre.89")
implementation npm("@jetbrains/kotlin-react-dom", "16.9.0-pre.89")
implementation npm("@jetbrains/kotlin-react-router-dom", "4.3.1-pre.89")
implementation npm("@jetbrains/kotlin-extensions", "1.0.1-pre.89")
implementation npm("react", "16.9.0")
implementation npm("react-dom", "16.9.0")
implementation npm("react-router-dom", "4.3.1")
}
}
test {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
}
}
}
}
Ivan Kubyshkin [JetBrains]
01/22/2020, 9:19 AMfcosta
01/22/2020, 10:49 AMIvan Kubyshkin [JetBrains]
01/22/2020, 12:14 PMimplementation "org.jetbrains:kotlin-react:16.9.0-pre.89-kotlin-1.3.60"
implementation "org.jetbrains:kotlin-react-dom:16.9.0-pre.89-kotlin-1.3.60"
implementation "org.jetbrains:kotlin-react-router-dom:4.3.1-pre.89-kotlin-1.3.60"
implementation "org.jetbrains:kotlin-extensions:1.0.1-pre.89-kotlin-1.3.60"
fcosta
01/22/2020, 12:57 PMfcosta
01/22/2020, 12:58 PMIvan Kubyshkin [JetBrains]
01/22/2020, 2:12 PM'kotlin-react-router-dom': '@jetbrains/kotlin-react-router-dom'
into webpack.config.d/03.resolve.js
2) https://youtrack.jetbrains.com/issue/KT-30619. You should add implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.3.3"
into build.gradle
Ivan Kubyshkin [JetBrains]
01/22/2020, 2:27 PMnpm
and @jetbrains/{something}
from maven.Ivan Kubyshkin [JetBrains]
01/22/2020, 2:27 PM// implementation npm("kotlinx-html", "0.6.12")
// implementation npm("@jetbrains/kotlin-react", "16.9.0-pre.89")
// implementation npm("@jetbrains/kotlin-react-dom", "16.9.0-pre.89")
// implementation npm("@jetbrains/kotlin-react-router-dom", "4.3.1-pre.89")
// implementation npm("@jetbrains/kotlin-extensions", "1.0.1-pre.89")
and leaveIvan Kubyshkin [JetBrains]
01/22/2020, 2:27 PMimplementation "org.jetbrains:kotlin-react:16.9.0-pre.89-kotlin-1.3.60"
implementation "org.jetbrains:kotlin-react-dom:16.9.0-pre.89-kotlin-1.3.60"
implementation "org.jetbrains:kotlin-react-router-dom:4.3.1-pre.89-kotlin-1.3.60"
implementation "org.jetbrains:kotlin-extensions:1.0.1-pre.89-kotlin-1.3.60"
Ivan Kubyshkin [JetBrains]
01/22/2020, 2:28 PMwebpack.config.d/03.resolve.js
fcosta
01/23/2020, 1:23 AM