Kotlin js webpack-dev-server HMR reload twice

Hi,
I followed this documentation.

Everything is working, but if I change a kotlin source the page in the browser is reloaded twice:

  • when the kotlin file is changed
  • when the kotlin file is compiled to javascript and emitted

How can we fix so the HMR is fired just once when the compilation is finished ?

thanks

You can try to disable source maps. See https://youtrack.jetbrains.com/issue/KT-44838

1 Like

Hi @rjaros, adding sourceMaps = false to build.gradle.kts, as you suggested, resolved the issue.

thank you very much

kotlin {
    js {
        browser {
            commonWebpackConfig {
                cssSupport.enabled = true
                sourceMaps = false
            }
        }
        binaries.executable()
    }
}