Home

Awesome

Incubator

Kotlin/Wasm Browser Example

A simple app drawing an input field for a timezone name and time in the timezone in the HTML document

Check it out:

Static Badge.

Set up the environment

Before starting, ensure you have the necessary IDE and browser setup to run the application.

IDE

We recommend using IntelliJ IDEA 2023.1 or later to work with the project. It supports Kotlin/Wasm out of the box.

Browser (for Kotlin/Wasm target)

To run Kotlin/Wasm applications in a browser, you need a browser supporting the Wasm Garbage Collection (GC) feature:

Chrome and Chromium-based

Firefox

Safari/WebKit

Wasm GC support is currently under active development.

Note: For more information about the browser versions, see the Troubleshooting documentation.

Build and run

To build and run the application:

  1. In IntelliJ IDEA, open the repository.

  2. Run the application by typing the following Gradle command in the terminal:

    ./gradlew wasmJsBrowserRun -t <br> <br>

Once the application starts, open the following URL in your browser:

http://localhost:8080

Note: The port number can vary. If the port 8080 is unavailable, you can find the corresponding port number printed in the console after building the application.

Feedback and questions

Give it a try and share your feedback or questions in our #webassembly Slack channel. Get a Slack invite. You can also share your comments with @bashorov on X (Twitter).

Learn more