Sergio Casero
05/13/2019, 9:17 AMERROR in ../node_modules_imported/kotlin-extensions/kotlin-extensions.js
Module not found: Error: Can't resolve 'core-js/features/object/assign' in '/home/sergio/projects/timesheet/js/build/node_modules_imported/kotlin-extensions'
@ ../node_modules_imported/kotlin-extensions/kotlin-extensions.js 112:37-78
@ ../node_modules_imported/kotlin-react-dom/kotlin-react-dom.js
@ ./output.js
Any help? It's rare because I have another project with exactly the same structure and works fine
I'll paste the build.gradle file on the threadSergio Casero
05/13/2019, 9:17 AMapply plugin: 'org.jetbrains.kotlin.frontend'
apply plugin: 'kotlin2js'
apply plugin: 'kotlinx-serialization'
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(":common")
compile "org.jetbrains.kotlinx:kotlinx-html-js:0.6.11"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutines_version"
compile "org.jetbrains:kotlin-react:16.6.0-pre.71-kotlin-1.3.31"
compile "org.jetbrains:kotlin-react-dom:16.6.0-pre.71-kotlin-1.3.31"
compile 'org.jetbrains:kotlin-extensions:1.0.1-pre.71-kotlin-1.3.31'
testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
}
sourceSets {
main.kotlin.srcDirs += 'src/main/kotlin'
}
kotlinFrontend {
downloadNodeJsVersion = "8.11.2"
sourceMaps = false
npm {
replaceVersion "kotlinx-html-js", "$kotlin_version"
replaceVersion "kotlinx-html-shared", "$kotlin_version"
replaceVersion "kotlin-js-library", "$kotlin_version"
replaceVersion "kotlin-extensions", "$kotlin_version"
dependency "react", "16.6.0"
dependency "react-dom", "16.6.0"
}
webpackBundle {
bundleName = "main"
contentPath = file('src/main/resources')
proxyUrl = "<http://localhost:9090>"
}
}
compileKotlin2Js {
kotlinOptions.metaInfo = true
kotlinOptions.outputFile = "$project.buildDir.path/js/output.js"
kotlinOptions.sourceMap = true
kotlinOptions.sourceMapEmbedSources = "always"
kotlinOptions.moduleKind = 'commonjs'
kotlinOptions.main = "call"
}
Lawik
05/13/2019, 9:35 AMcore-js
to your npm dependencies.Sergio Casero
05/13/2019, 9:41 AMSergio Casero
05/13/2019, 9:41 AM./gradlew js:run
or npm start
??Robert Jaros
05/13/2019, 9:46 AMcore-js
, probably your project is using the older versionRobert Jaros
05/13/2019, 9:47 AMnpm {
dependency("core-js", "3.0.0")
}
Sergio Casero
05/13/2019, 9:49 AMreplaceVersion "core-js", "3.0.1"
Sergio Casero
05/13/2019, 9:49 AMSergio Casero
05/13/2019, 9:50 AMnapperley
05/13/2019, 9:46 PMRobert Jaros
05/13/2019, 10:44 PM