Kilua guide
  • Kilua Guide
  • Introduction
  • Compose world
  • 1. Getting Started
    • Setting Up
    • Creating a New Application
    • Modules
    • Development Workflow
    • Hot Module Replacement
    • Debugging
    • Building For Production
  • 2. Frontend Development Guide
    • Composable functions
    • Browser APIs
    • Interoperability with JavaScript
    • Working with Compose
    • Rendering HTML
    • Type-safe CSS properties
    • Resources
    • Icons
    • Routing
    • Layout containers
    • Events
    • Forms
    • Form controls
    • SVG images
    • Drag and drop
    • Internationalization
    • REST client
    • Markdown and sanitization
    • Using Bootstrap
    • Using TailwindCSS
    • Using Tabulator
    • Animation
    • Using Jetpack Compose API
  • 3. Fullstack Components
  • Useful References
Powered by GitBook
On this page
  1. 1. Getting Started

Debugging

PreviousHot Module ReplacementNextBuilding For Production

Last updated 6 days ago

You can easily debug Kilua applications in most modern browsers (e.g. Chrome or Firefox), which support source maps generated by Kotlin/JS compiler. Source maps allow you to see Kotlin source code in the browser "Sources" panel. You can see line numbers, step through your code, set breakpoints and watch variable values just like with plain JavaScript.

WasmJs debugging is currently not supported.

You can also debug Kilua application directly in IntelliJ IDEA Ultimate by creating new "JavaScript Debug" configuration pointing to url.

Note: Source maps are disabled by default in all Kilua template projects, because the development cycle (hot reload) is a lot faster without them. To enable source maps you need to remove line sourceMaps = false from your build.gradle.kts file and remove line config.devtool = 'eval-cheap-source-map' from webpack.config.d/webpack.js file.

Console.log

Some UI interactions may be tricky to handle with a debugger, and so being able to fall back to console logging is useful. When developing in common code, you can't import and access native kotlin.js.console object. You can use web.console.console object, declared in kotlin-wrappers instead.

http://localhost:3000