Kotlin JS incremental compilation


With activated incremental compilation for JS, from time to time (after several refreshes) i get the following error:

kotlinx-coroutines-core.js?9f8c:19657 Error: This marker function should never been called. Looks like compiler did not eliminate it properly. Please, report an issue if you caught this exception.
at throwMarkerError (markerFunctions.js?15ef:75)
at Object.Kotlin.coroutineReceiver (markerFunctions.js?15ef:67)
at Coroutine$AppointmentCreateComp$componentDidMount$lambda.doResume (AtomicFU.common.kt?573b:281)
at Coroutine$AppointmentCreateComp$componentDidMount$lambda.CoroutineImpl.resumeWith_tl1gpc$ (CoroutineImpl.kt?e888:47)
at DispatchedContinuation.DispatchedTask.run (kotlinx-coroutines-core.js?9f8c:2676)
at WindowDispatcher$queue$ObjectLiteral.MessageQueue.process (kotlinx-coroutines-core.js?9f8c:19918)
at eval (kotlinx-coroutines-core.js?9f8c:19887)

I use the Kotlin frontend plugin, and this appears when webpack dev server has reloaded the page after recompilation. Is this may a bug, or have anyone advice how to tweak the configuration to solve that?

Thanks in advance.


Without incremental compilation, the Webpack dev server was not able to reload on changes because js compile output files get deleted during compilation. My workaround is to disable incremental build and place a Webpack configuration file in webpack.config.d folder with the following content.

if (defined.PRODUCTION === false || defined.PRODUCTION === 'false') {
    config.devServer = {
        watchOptions: {
            aggregateTimeout: 5000,
            poll: 1000

Now i am able to use Webpack dev server with HOT and must not restart the whole dev server for each change.

Maybe this helps other people with the same problem.


@werrenmi Thank you for reporting the bug and the workaround =)

The issue seems to be the same as in KT-29360.
It should be fixed in the already released 1.3.21. Could you please check whether updating to 1.3.21 fixes the incremental compilation issues in your case?


Hi @Anton.Bannykh

Sorry for my late reply. Yes i saw this fix and was exactly this one. Thx!