Hey, I receive error `duplicate target file will b...
# javascript
a
Hey, I receive error
duplicate target file will be created for 'build/node_modules/kotlin-compiler/lib/kotlin-stdlib-js.jar!kotlin.js' and 'build/node_modules/kotlin-compiler/lib/kotlin-jslib.jar!kotlin.js'
(step
:runDceKotlinJs'
) when trying to build my project on Ubuntu. I can build it on Windows. Kotlin version is 1.2.30. Where can be a problem?
b
kotlin-jslib.jar
is deprecated
could you please show your build file?
or just dependencies
a
Copy code
dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
    compile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
    compile "org.jetbrains.kotlinx:kotlinx-html-js:$html_version"
    compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core-js:0.22.5'
    compile "org.jetbrains:kotlin-extensions:1.0.1-pre.19-kotlin-$kotlin_version"
    compile "org.jetbrains:kotlin-react:$react_version"
    compile "org.jetbrains:kotlin-react-dom:$react_version"
    compile "org.jetbrains:kotlin-react-router-dom:$react_router_dom_version"
}
Copy code
apply plugin: 'kotlin2js'
apply plugin: 'kotlin-dce-js'
apply plugin: 'org.jetbrains.kotlin.frontend'
@bashor Do you have any idea why this error appears?
Is DCE for Dead Code Elimination? Is it ok just to remove line
apply plugin: 'kotlin-dce-js'
?
a
@Andrew Gein Yes, here is a tutorial: https://kotlinlang.org/docs/reference/javascript-dce.html
a
Thanks, I've just removed usage of this plugin. Now I am able to build project under ubuntu
a
I am pretty sure kotlin-frontend-plugin sets up DCE internally, so you shouldn't lose the minification when you run
bundle
If that's not the case, ping me, I'll figure somthing out for you.
By the way, which task do you run when this happens? Does kotlin-frontend-plugin trigger that? I remember it having similar issues a few months ago, maybe it wasn't fixed for all cases.