Kotlin Javascript source mapping and IntelliJ node.js debugging


I’m little bit experimenting with Kotlin2js and node.js.
I wonder if it’s possible to enable debugging directly within Kotlin code, so far I’m getting only JavaScript debugger to work on transpiled code.
I know that there are source code maps generated and it works for example in Chrome debugger on browser side.

I’m compiling Kotlin code with Gradle plugin, then starting Node.js in debug mode and starting remote debug of Node.js pointing to the server.

Here is the source:


Ok, small update. I managed to get it to at least jump into Kotlin code.
The main problem was probably in wrong working directory in debug configuration and now I’m using IntelliJ node.js run/debug configruation (not remote Node.js debugging).
Breakpoints work only in JavaScript code, but with Step Into I can actually step in Kotlin code. Breakpoints are still not working for me in the Kotlin code. At least I can debug in the transpiled code.


Sorry for delay!

It’s KT-4078, feel free to vote to get updates.

You can workaround it by open Your html directly form FS or make all path relative in my-app.js.map file (by removing wrong suffix).