Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
99 views

I need lenses on nested data classes in Kotlin for the JavaScript target. Since Arrow is not available for KotlinJS: Are there any libraries, examples, gists, available? Or has at least somebody an ...
jens's user avatar
  • 453
1 vote
1 answer
1k views

I've got a Kotlin JS project and I'm trying to add some npm dependencies via Gradle. My understanding is that I have to add the npm deps to the the dependencies of this source set, like so: plugins { ...
PaulNUK's user avatar
  • 5,309
0 votes
2 answers
210 views

Hopefully this is a common issue that someone can help me with ? I've got a data class that has a kotlin,js.Date on it. If I print out the value of it via console.log I get: 2019-12-29T13:30:00.000+...
PaulNUK's user avatar
  • 5,309
1 vote
1 answer
1k views

I have built a Kotlin multiplatform library and published it to bintray. When trying to include it in a sample node.js application it will be able to find the dependency, but compiling will fail with ...
mikepenz's user avatar
  • 12.9k
3 votes
1 answer
598 views

Right now, IntellJ is showing a red squiggly line saying: Argument must be a string constant private fun fromEnv(name: String) { return js("process.env[${name}]") as Unit } I've searched but I ...
Richard Domingo's user avatar
2 votes
1 answer
2k views

how can i change item's data type in arrays or lists in kotlin ? i found a usual way but i need an easier and faster and better way to change data type of an array :) fun typeChanger (data:...
Mahdi Safarmohammadloo's user avatar
1 vote
1 answer
85 views

As of Kotlin 1.3.41, the kotlin js compiler would produce the js files for dependencies (e.g. the standard lib kotlin.js). In Kotlin 1.3.50 and 1.3.60, these dependencies are no longer produced. How ...
Ben Simon's user avatar
  • 121
1 vote
0 answers
147 views

I'm missing or looking for is something similar to a maven archetype or a yoeman generator. I need a starter project with best practices with the basic plumbing and scaffolding in place which i can ...
Denounce'IN's user avatar
0 votes
0 answers
568 views

I am trying to redirect to another web page in Kotlin for Web Front End development. I have wrote this code to achieve this: window.location.href = "adduser1.html" But if I write this code then, the ...
Avijit Karmakar's user avatar
1 vote
1 answer
201 views

I am creating interactive infographics using Google Charts and Kotlin JS. This is snippet from Quick Start Page. var data = new google.visualization.DataTable(); <..> var chart = new google....
egorponomaryov's user avatar
0 votes
1 answer
88 views

I want to build a frontend in kotlin/react. I want it to be able to depend on common artefacts written in kotlin. These artefacts will be in my local maven repo. How do I reference these in package....
Funzo's user avatar
  • 1,300
1 vote
1 answer
88 views

I am trying to implement Firebase Email-Password Authentication using Kotlin in Web Front-End. But I think we can't do it using Kotlin as Firebase Authentication for Web only supports JS as per the ...
Avijit Karmakar's user avatar
0 votes
1 answer
276 views

I try to create a whole-stack project using Kotlin. As multiplatform projects are experimental in Kotlin, there is not much information available, so I tried to start from the project skeleton of IDEA ...
Balage1551's user avatar
  • 1,077
2 votes
1 answer
356 views

I'm trying to use google-maps-react component as part of a Kotlin JS project but running in to some issues with how the way it's used maps to Kotlin. I have following google-maps-react.kt file so far: ...
John O'Reilly's user avatar
1 vote
2 answers
650 views

The version of Node.js that KotlinJS downloads (as of 1.3.40+) seems not to work in Alpine Linux. The docker image I'm using already has Node baked into it, so there's no reason not to use that one. ...
Max's user avatar
  • 5,121
1 vote
1 answer
580 views

I want to testing js project, written on kotlin js. For example, test, which elements added after click on btn. How can I do it? Such as @Test fun myTest() { when{ window.onLoad().await() ...
Alexey Stepanov's user avatar
2 votes
1 answer
1k views

I have a Kotlin function written that consumes a List<String>. The function has an annotation with @JsName so that I can call this function from JavaScript. I cannot determine though what I am ...
Vance T's user avatar
  • 563
5 votes
3 answers
2k views

Do I have to define them externally like so: external fun setTimeout(exec: suspend () -> Unit, timout: Int) Or is there something in the stdlib I can use? I can't use kotlin.browser.window....
thi gg's user avatar
  • 2,083
7 votes
1 answer
5k views

Is it possible to launch any coroutines when targeting JavaScript? It doesn't like any of the usual ways like async{} Example on: https://github.com/thigg/no-kotlinx-in-js
thi gg's user avatar
  • 2,083
1 vote
1 answer
172 views

Bear with me, I don't yet see the whole picture of how multiplatform works. What I want to achieve is have some business logic, which at the end is compiled into a a js file that I can use in an HTML,...
chrystolin's user avatar
  • 1,087
9 votes
2 answers
757 views

Given this code: val value = "something" println(value.toUpperCase().toLowerCase() == value) // prints true println(value.toUpperCase().toLowerCase() === value) // prints false On Kotlin/JVM 1.3....
CommonsWare's user avatar
1 vote
1 answer
348 views

I am building a very simple web-based 'breakout', and I have run into trouble when trying to make the ball move on the canvas element. I do have the game up and running in javascript. Thing is, I am ...
luis lyra's user avatar
2 votes
3 answers
1k views

I've been writing simple web-frontend for application with kotlin-js and faced with a problem of exception handling. As I see, there is no API to get exception stacktrace: https://kotlinlang.org/api/...
Eduard Minasyan's user avatar
3 votes
3 answers
2k views

EDIT: This is not supported yet and tracked on Kotlin YouTrack I'm trying to write a Kotlin external declaration matching the following Typescript interface (this is valid TS to represent JavaScript ...
Joffrey's user avatar
  • 38.3k
2 votes
1 answer
302 views

I have kotlin2js plugin with task compileKotlin2Js. I configure it like this: val compileKotlin2Js: Kotlin2JsCompile by tasks compileKotlin2Js.kotlinOptions { main = "call" outputFile = "${...
leaf's user avatar
  • 95
0 votes
1 answer
187 views

I've created a simple react app using create-react-kotlin-app. After successful npm start, I tried to get a build of the project using IntelliJ IDEA's Build -> Build Project, but it fails stating ...
theapache64's user avatar
  • 11.8k
2 votes
1 answer
386 views

This question is about a Kotlin JS project which uses the Kotlin Frontend Plugin. I want to use some UI components from the Vaadin Components library. I have two questions about this: (1) What ...
monk's user avatar
  • 690
0 votes
1 answer
541 views

I'm totally new in KotlinJs and I wanted to check its potential in server-less service development. I decided to start with calling external API with HTTP GET method using XMLHttpRequest() suggested ...
Przemysław Gęsieniec's user avatar
3 votes
1 answer
607 views

I want to use kotlin.js parse, but I don't know how to import it. I tried import org.jetbrains.kotlin.js.parser.sourcemaps.*; but it didn't include JSON parse
Valery Lyalin's user avatar
0 votes
1 answer
1k views

During my fresh adventures with kotlin-react I hit a hard stop when trying to parse some data from my backend which contains enum values. Spring-Boot sends the object in JSON form like this: { "id":...
geisterfurz007's user avatar
3 votes
1 answer
1k views

There is a library called kotlin.math which contains a method pow: import kotlin.math.pow val factor = pow(10.0, 2) print(factor) and result: 100.0 However Intellij is not registering that I have ...
Robbie Cronin's user avatar
1 vote
1 answer
281 views

I'm trying to call from plain JavaScript into a Kotlin module that has been compiled into JavaScript. One of the Kotlin methods inside the module requires a kotlin.collections.Set to be passed. How ...
ujay68's user avatar
  • 410
6 votes
2 answers
3k views

Given this code, where should I place the file.json to be able to be found in the runtime? // path: src/main/kotlin/Server.kt fun main() { val serviceAccount = require("file.json") } I tried place ...
Diolor's user avatar
  • 13.5k
2 votes
2 answers
2k views

I am trying to develop a Nodejs application using Kotlin 1.3.11 using the IntelliJ IDEA CE development environment. Unfortunately I haven't made any progress towards a running application. To ensure ...
steambrew's user avatar
9 votes
3 answers
1k views

Every function and variable that I create in KotlinJs project gets into a module. But I need to define some functions in global scope. I use p5js library (pure js). It allows user to define event ...
Sergey Belonozhko's user avatar
4 votes
1 answer
428 views

In Kotlin 1.3.20 and Gradle 4.10.2, it is possible to hot reload js files with the following in Gradle: task watch { inputs.files 'src/main' doLast { compileKotlin2Js.execute() } }...
AlexO's user avatar
  • 1,472
0 votes
1 answer
300 views

I want to incude javascript dependencies in my kotlinjs project. (concret : https://airbnb.io/polyglot.js/ but others as well). My kotlinjs Project is a gradle Project, developed in IntelliJ Idea. ...
henry86's user avatar
  • 189
0 votes
2 answers
503 views

I'm bootstrapping a KotlinJS + React application using the following steps: npm install -g create-react-kotlin-app create-react-kotlin-app frontend cd frontend npm install kotlinx-coroutines-core npm ...
Jan Vladimir Mostert's user avatar
2 votes
1 answer
498 views

I try to write a type-safe wrapper for a JavaScript library. I need to call a method from JavaScript with variable arguments (e.g. method(args...)). The Kotlin fun for this should work with variable ...
Felix Stupp's user avatar
15 votes
2 answers
11k views

I have a JavaScript build in my Kotlin project. How can I produce full TypeScript code instead of JavaScript? I use Maven; but if you have a Gradle solution, I'm interested.
sab's user avatar
  • 5,192
1 vote
1 answer
94 views

I have a project using "kotlinFrontend" to create a really nice react front end written in kotlin. How do i get access to the facebook js sdk (it is usually done withing script tags) I have this code ...
Chris Legge's user avatar
2 votes
1 answer
513 views

I am making some kotlin JS wrappers for Firebase Javascript SDK. So I created the project with the external keyword and @file:JsModule annotation, something like that: @file:JsModule("@firebase/...
Allan Veloso's user avatar
  • 6,549
2 votes
2 answers
1k views

Example: In @material-ui/core/createMuiTheme.d.ts there are a few interfaces defined, e.g. ThemeOptions and Theme It's possible to generate koltin bindings using ts2kt and it allows using ...
Sam's user avatar
  • 1,662
6 votes
3 answers
673 views

I'm trying to compile my Kotlin app and set of Kotlin libraries to JavaScript. I've got that working well, but when I try to run it it can't find kotlin.js. So what's going on here? When I compile ...
Ky -'s user avatar
  • 32.4k
2 votes
2 answers
2k views

Build fails with error messages: ERROR in ./output.js Module not found: Error: Can't resolve 'common' in 'C:\Users\User\Documents\MultiPlatformTodo\web\web' @ ./output.js 340:91-108 ERROR ...
Edson Menegatti's user avatar
0 votes
1 answer
2k views

I'm trying to compile my Kotlin app and set of Kotlin libraries to JavaScript. I've got that working well, but when I try to run it, it can't find kotlin.js. To remedy this, I tried changing my build....
Ky -'s user avatar
  • 32.4k
18 votes
1 answer
14k views

I'm trying to understand the journey Kotlin source code goes through when it is compiled. The documentation states When targeting the JVM, Kotlin produces Java compatible bytecode. When targeting ...
Alessandro Lorusso's user avatar
0 votes
2 answers
4k views

I'm using IntelliJ. I can run Java or Kotlin project without any issue but I can't build Kotlin-JS project I have the error Error: Could not find or load main class MainKt My IntelliJ information ...
Khyxes's user avatar
  • 15
0 votes
1 answer
78 views

I'm trying to wrap this simple API: https://github.com/github-tools/github, just for study purpose. So, I created this external classes: package index import com.github.jesty.githubapi.Result import ...
Davide Cerbo's user avatar
1 vote
1 answer
698 views

Been writing a lot of React with kotlin using the front end plugin. It has been amazing thus far doing nothing overly exotic. I am now trying to render stored HTML in my react component. I am ...
Chris Legge's user avatar