Open SebastianAigner opened 5 years ago
Any news about this issue?
if my build.gradle.kts
is below.
how to do it?
plugins {
id("org.jetbrains.kotlin.js") version "1.4.10"
}
group = "org.exmaple"
version = "1.0"
repositories {
maven("https://kotlin.bintray.com/kotlin-js-wrappers/")
mavenCentral()
jcenter()
}
dependencies {
implementation(kotlin("stdlib-js"))
//React, React DOM + Wrappers (chapter 3)
implementation("org.jetbrains:kotlin-react:16.13.1-pre.110-kotlin-1.4.0")
implementation("org.jetbrains:kotlin-react-dom:16.13.1-pre.110-kotlin-1.4.0")
implementation(npm("react", "16.13.1"))
implementation(npm("react-dom", "16.13.1"))
//Kotlin Styled (chapter 3)
implementation("org.jetbrains:kotlin-styled:1.0.0-pre.110-kotlin-1.4.0")
implementation(npm("styled-components", "~5.1.1"))
implementation(npm("inline-style-prefixer", "~6.0.0"))
//Video Player (chapter 7)
implementation(npm("react-player", "~2.6.0"))
//Share Buttons (chapter 7)
implementation(npm("react-share", "~4.2.1"))
//Coroutines (chapter 8)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
}
kotlin {
js {
browser {
webpackTask {
cssSupport.enabled = true
}
runTask {
cssSupport.enabled = true
}
testTask {
useKarma {
useChromeHeadless()
webpackConfig.cssSupport.enabled = true
}
}
}
binaries.executable()
}
}
@iHad169 you need to add useCommonJs()
inside js { }
, like this:
kotlin {
js {
browser {
webpackTask {
cssSupport.enabled = true
}
runTask {
cssSupport.enabled = true
}
testTask {
useKarma {
useChromeHeadless()
webpackConfig.cssSupport.enabled = true
}
}
}
binaries.executable()
useCommonJs()
}
}
If I uncomment the
useCommonJs
directive from mybuild.gradle.kts
file like so:The project is no longer able to compile: