Questions tagged [kotlin-js]
281 questions
3
votes
1 answer
Percent unit from CSS to Kotlin React?
I was trying to use the percent unit (%) from CSS to my Kotlin React file, it has the others unit but I cant find this one. I was looking in Length.kt. If there's not that unit, how could I do the same? I'm trying to make an input with 50% height…

DomeScoppe
- 31
- 2
3
votes
0 answers
Creating JS library with kotlin multi platform and use it on angular 2 via npm
I created and simple kotlin multi platform application and i want to use it on angular project via publishing on npm.
Here is my build.gradle.kts file
plugins {
kotlin("multiplatform")
kotlin("native.cocoapods")
…

ALKIN ÇAKIRALAR
- 237
- 2
- 14
3
votes
1 answer
Kotlin multiplatform gradle task "jsRun" gives error "[webpack-cli] TypeError: cli.isMultipleCompiler is not a function"
I have a Kotlin multiplatform project with JVM and JS. When executing jsRun gradle task to start the webpack server, it fails with the following error:
Waiting for changes to input files of tasks... (ctrl-d then enter to exit)
[webpack-cli]…

Jordi
- 2,055
- 1
- 16
- 34
3
votes
2 answers
Serialize generic class using kotlinix.serialization in Kotlin/JS fails
Serializing a generic class with kotlinx.serialization succeeds in JVM but fails in JavaScript with message TypeError: tmp$.serializer is not a function. Please, see the following Unit Test.
import kotlinx.serialization.Serializable
import…

Jordi
- 2,055
- 1
- 16
- 34
3
votes
1 answer
How to use AsyncGenerators with Kotlin/JS?
I'm currently trying to use IPFS with Kotlin/JS, though my problem isn't specific to that.
The ipfs.cat() and ipfs.get() functions return an AsyncGenerator and I'm unsure how to iterate over it with Kotlin (I'm not even sure which type would best…

Minmo
- 143
- 3
- 6
3
votes
0 answers
Access Javascript file in Kotlin/JS
I have a bunch of Javascript files I need to access from Kotlin Code.
I created a js-files directory in my root project with the needed .js files and a package.json which looks like this:
{
"name": "js-files",
"version": "1.0.0",
…

Intektor
- 321
- 2
- 13
3
votes
1 answer
Make use of web component library in Kotlin Compose for Web
I want to tinker with Kotlin Compose for Web a bit.
In some of my past web projects, I made use of some web components of the Clarity Design System (CDS).
In a JavaScript or TypeScript project,
you first need to install both npm packages@cds/core…

Endzeit
- 4,810
- 5
- 29
- 52
3
votes
1 answer
Uncaught ReferenceError: firebase is not defined in Kotlin/JS project with Dukat generated declarations
In a basic kotlin js project, I imported the firebase dependency. I used Dukat to get access to the type references and got them to compile. My kotlin compiles like a charm, however it seems to me like the bundle created by webpack does not contain…

jlengrand
- 12,152
- 14
- 57
- 87
3
votes
1 answer
Deploying KotlinJs React web app to Heroku, error extracting tar content of undefined failed
I have the following setup. Kotlin Multiplatform project with a Web App and Shared module. I also have included a build of a library that I had to modify myself as it wasn't working properly.
When trying to deploy to Heroku with these steps I get…

Nikola-Milovic
- 1,393
- 1
- 12
- 35
3
votes
1 answer
How to compile a Kotlin file to JavaScript?
Hi I am getting started with KotlinJS on Node and I've put a very simple kotlin file and I want to compile it using the raw kotlinc-js compiler. Without using gradle
package main
fun heavy() {
(1..10_000_000).forEach { it*it }
}
fun main() {
…

Some random IT boy
- 7,569
- 2
- 21
- 47
3
votes
0 answers
Kotlin/JS — Compile a JS library with types defined in NPM dependency
I’m trying to write a library using the new Kotlin/JS IR compiler. Specifically, I want to write the library using Kotlin, but to publish it as a NPM package to be used in a Typescript/Node project.
I have a NPM dependency in the project defined…

jsfr
- 55
- 4
3
votes
1 answer
Koltin Multiplatform Multi Module JVM/JS Project Setup
I need to convert existing multi-module jvm project into a multiplatform project.
//Exisiting Modules: (JVM Project)
core
data
app
app_server
utils
db
//Need to add:
app_frontend (Kotlin/JS)
Need to share data module between JVM and JS
Thanks in…

wishnuprathikantam
- 113
- 8
3
votes
2 answers
Setting output path for Kotlin/JS distribution / webpack output
When building my project using the browserDistribution Gradle task, Kotlin/JS puts the output which has been processed by webpack into /build/distributions/myProject.js.
Instead, I would like my output to go into a folder called /output in my…

Sebastian A.
- 402
- 2
- 9
3
votes
2 answers
How to import react-bootstrap component with children into kotlin-js react app
I want to use a bootstrap Card component in a react website created with kotlin-js. The app uses kotlin-react wrapper and react-bootstrap library.
react-bootstrap documentation says use to put content.
This is some…

tiptop
- 33
- 5
3
votes
1 answer
How to properly begin with Kotlin.js
I am fairly new to the world of web development and was looking resources to get started. I had prior knowledge of Kotlin and I learned that I can use Kotlin.js to build my webApps/website. I tried looking for some guides/tutorials on the web to…

sangeetds
- 390
- 2
- 12