Debug Kotlin/JS in the browser
Kotlin/JS Gradle plugin automatically generates source maps for the project builds. These enable support for debugging the code using browser development tools. To get started debugging your code, execute the
run task in a project using the JS Gradle plugin, or
browserDevelopmentRun in a multiplatform project. Once the development server is running, you can start a debugging session from the browser.
To begin debugging, navigate to the page and launch the developer tools of the browser (for example by right-clicking and selecting the Inspect action). If your program is logging information to the console, navigate to the Console tab to see this output. Depending on your browser and its developer tools, these logs will also reference the Kotlin source files they originate from: