Hi! I have a project with an old stack, and now I'...
# javascript
с
Hi! I have a project with an old stack, and now I'm trying to update it and upgrade the libraries. I've reached the point of replacing the LEGACY compiler with IR. But after the replacement, the project does not start and displays this error. What could be the problem, maybe in gradle? Thanks for the help!
Copy code
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig

plugins {
    kotlin("js")
}

val kotlinxHtmlVersion: String by project
val kotlinxSerializationVersion: String by project
val kotlinWrappersSuffix: String by project
val kotlinxCoroutinesVersion: String by project
val d3Version: String by project
val d3SelectionMultiVersion: String by project
val leafletVersion: String by project
val leafletMarkerClusterVersion: String by project
val visTimelineVersion: String by project
val visDataVersion: String by project
val momentVersion: String by project
val enzymeVersion: String by project
val enzymeAdapterVersion: String by project
val reactFlowVersion: String by project
val ktorVersion: String by project

fun kotlinWrappers(target: String): String = "org.jetbrains.kotlin-wrappers:kotlin-$target"

repositories {
    mavenCentral()
}

kotlin {
    js(IR) {
        useCommonJs()
        browser {
            commonWebpackConfig {
                showProgress = true // включение в логах прогресса загрузки клиента
                sourceMaps = false // отключение двойной перезагрузки клиента
            }
            distribution {
                directory = project.file("../www/static")
            }
            runTask {
                devServer?.run {
                    proxy = mutableMapOf("/" to "<http://localhost:8080>")
                    port = 3000
                    static = mutableListOf("$buildDir/processedResources/frontend/main")
                    open = true
                }
            }
            testTask {
                testLogging {
                    showExceptions = true
                    exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
                    showCauses = true
                    showStackTraces = true
                }
            }
        }
        binaries.executable()
        nodejs {
            testTask {
                testLogging {
                    showExceptions = true
                    exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
                    showCauses = true
                    showStackTraces = true
                }
            }
        }
    }
}

dependencies {
    implementation(project(":common:connectionData"))
    implementation(project(":common:data"))
    implementation(project(":libs:!microservice:microserviceModel"))
    implementation(project(":libs:loggerLib"))
    implementation(kotlin("reflect"))

    implementation("io.ktor:ktor-client-core:$ktorVersion")
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-js:$kotlinxSerializationVersion")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
    implementation("org.jetbrains.kotlinx:kotlinx-html:$kotlinxHtmlVersion")

    implementation(enforcedPlatform(kotlinWrappers("wrappers-bom:1.0.0-${kotlinWrappersSuffix}")))

    implementation(kotlinWrappers("react"))
    implementation(kotlinWrappers("react-dom"))
    implementation(kotlinWrappers("react-router-dom"))
    implementation(kotlinWrappers("redux"))
    implementation(kotlinWrappers("react-redux"))
    implementation(kotlinWrappers("extensions"))
    implementation(kotlinWrappers("emotion"))

    implementation(npm("d3", d3Version))
    implementation(npm("d3-selection-multi", d3SelectionMultiVersion))
    implementation(npm("leaflet.markercluster", leafletMarkerClusterVersion))
    implementation(npm("leaflet", leafletVersion))
    implementation(npm("vis-timeline", visTimelineVersion))
    implementation(npm("vis-data", visDataVersion))
    implementation(npm("moment", momentVersion))
    implementation(npm("reactflow", reactFlowVersion))

//    testImplementation("org.jetbrains.kotlin:kotlin-test-js")
//    testImplementation(npm("enzyme", enzymeVersion))
//    testImplementation(npm("enzyme-adapter-react-16", enzymeAdapterVersion))
}

tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile>().configureEach {
    kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.time.ExperimentalTime"
}
🧵 1
t
./semantic-core-libs-
- link on local subproject?
с
yes, this is module
t
Looks like it has broken name or module name
Which ends with
-
Possible temp workaround - add in
gradle.properties
:
Copy code
kotlin.js.ir.output.granularity=whole-program
2