# Kotlin js webpack-dev-server HMR reload twice

**URL:** <https://discuss.kotlinlang.org/t/kotlin-js-webpack-dev-server-hmr-reload-twice/24608>\
**Category:** Uncategorized\
**Created:** [April 13, 2022, 2:52pm UTC](https://discuss.kotlinlang.org/t/kotlin-js-webpack-dev-server-hmr-reload-twice/24608 "2022-04-13T14:52:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frhack](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@frhack](https://discuss.kotlinlang.org/u/frhack)\
**Post date:** [April 13, 2022, 2:52pm UTC](https://discuss.kotlinlang.org/t/kotlin-js-webpack-dev-server-hmr-reload-twice/24608/1 "2022-04-13T14:52:29Z")

</div>

Hi,  
I followed this [documentation](https://kotlinlang.org/docs/dev-server-continuous-compilation.html).

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

---

<div class="post-metadata">

**Author:** ![rjaros](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@rjaros](https://discuss.kotlinlang.org/u/rjaros)\
**Post date:** [April 13, 2022, 3:35pm UTC](https://discuss.kotlinlang.org/t/kotlin-js-webpack-dev-server-hmr-reload-twice/24608/2 "2022-04-13T15:35:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![frhack](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@frhack](https://discuss.kotlinlang.org/u/frhack)\
**Post date:** [April 14, 2022, 6:25am UTC](https://discuss.kotlinlang.org/t/kotlin-js-webpack-dev-server-hmr-reload-twice/24608/3 "2022-04-14T06:25:34Z")

</div>

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

thank you very much

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

```
