Hi! How can I fix the error? I'm converting the si...
# javascript
с
Hi! How can I fix the error? I'm converting the site to https (ssl), using ktor. The error appears on the client: [webpack-dev-server] [HPM] Error occurred while processing request localhost:3000/ to https://localhost:8443 / [DEPTH_ZERO_SELF_SIGNED_CERT] (https://nodejs.org/api/errors.html#errors_common_system_errors ) As I understand it, you can disable the security check ["secure": false]. How to do it here? gradle client inside
🧵 2
Copy code
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(LEGACY) {
        useCommonJs()
        browser {
            commonWebpackConfig {
                showProgress = true // включение в логах прогресса загрузки клиента
                sourceMaps = false // отключение двойной перезагрузки клиента
            }
            distribution {
                directory = project.file("../www/static")
            }
            runTask {
                devServer?.run {
                    proxy = mutableMapOf("/" to "<https://localhost:8443>")
                    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(":libs:loggerLib"))
    implementation(project(":common:connection"))
    implementation(project(":common:data"))
    implementation(kotlin("reflect"))
    implementation(project(":libs:!microservice:microserviceModel"))

    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"
}
a
@Ilya Goncharov [JB] ^^
с
What?
a
I've tagged a guy who worked on the gradle plugin and can answer your question with details
👍 1
i
We don’t have
secure
property in Gradle DSL yet, you can configure webpack manually with
<project>/webpack.config.d/index.js
Copy code
config.devServer = config.devServer || {};
config.devServer.proxy [
      {
        context: ['/'],
        target: '<https://localhost:8443>',
        secure: false,
      },
    ];