kotlin-js Questions

2

Solved

Trying to build the a kotlin/js project and getting the following exception: error package.json: Name contains illegal characters The project is here: https://github.com/darran-kelinske-fivesta...
Inactivate asked 4/3, 2020 at 21:11

2

Let's imagine something like this: var num: Float = 0.0f num = 2.4 * 3.5 / 3.8 num has several decimals, but I want only 2. In JS I would use num.toFixed(2). Other answers here suggest to use &quo...
Croner asked 14/3, 2017 at 16:30

8

Solved

how to create JavaScript anonymous object in kotlin? i want to create exactly this object to be passed to nodejs app var header = {“content-type”:”text/plain” , “content-length” : 50 ...}
Saltigrade asked 26/1, 2015 at 12:27

3

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.s...
Bullnose asked 3/8, 2019 at 21:45

2

Solved

I created a new Kotlin/JS Gradle project using the wizard in IntelliJ. I'm unclear how I'm supposed to add css to the project. The documentation explains how to enable css webpack support, but it d...
Calderon asked 24/1, 2021 at 21:58

3

Solved

I've created a multi-platform Kotlin project (JVM & JS), declared an expected class and implemented it: // Common module: expect class Request(/* ... */) { suspend fun loadText(): String } /...
Haggard asked 23/12, 2017 at 22:14

3

Solved

I was doing the tutorial for React Kotlin and couldnt even finish the setup step because the server does not start. The code is unchanged : https://github.com/kotlin-hands-on/web-app-react-kotlin-j...
Quinonez asked 12/10, 2021 at 9:8

2

Solved

I have a project with multiple subprojects that use the kotlin-multiplatform plugin or the kotlin-js plugin and I want to use the experimental unsigned types in all of them. So far I've tried this,...
Saxen asked 3/10, 2020 at 12:17

1

Solved

I am new to JS and to Kotlin/JS. I have the following minimal working Javascript code for a Plugin for Obsidian from an example. It works as expected: var obsidian = require('obsidian'); class Some...
Nordine asked 7/7, 2021 at 21:11

2

If I have a JavaScript file called myfile.js as follows: function myJsFunc() { return "Hello from JavaScript"; } How can I import this file into a Kotlin/JS project and invoke myJsFunc()...
Muzz asked 23/5, 2021 at 14:57

1

Solved

considering the following javascript code (partially taken from Apollo Server documentation), it creates an instance of ApolloServer and start it. const {ApolloServer} = require('apollo-server') ...
Icicle asked 24/4, 2020 at 23:43

2

Solved

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.
Beshore asked 7/1, 2019 at 21:44

3

Solved

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...
Preliminary asked 2/12, 2018 at 17:13

1

Solved

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
Czarina asked 3/8, 2019 at 21:43

2

Solved

Given this code: val value = "something" println(value.toUpperCase().toLowerCase() == value) // prints true println(value.toUpperCase().toLowerCase() === value) // prints false On Kotlin/JVM 1....
Marsipobranch asked 1/7, 2019 at 11:55

2

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 pl...

3

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 ...

1

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 bui...
Curtsey asked 2/12, 2018 at 2:36

1

Solved

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 targetin...
Matriculate asked 25/11, 2018 at 22:36
1

© 2022 - 2024 — McMap. All rights reserved.