https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
javascript
  • s

    Soren Valle

    08/10/2019, 5:22 PM
    with the new js plugin
    o
    s
    • 3
    • 3
  • j

    jcogilvie

    08/12/2019, 7:42 PM
    documentation bug: adding
    outputFile
    onto
    compileKotlin2Js
    actually seems to break the proposed code for
    assembleWeb
    (since
    destinationDir
    stops resolving) https://kotlinlang.org/docs/tutorials/javascript/getting-started-gradle/getting-started-with-gradle.html
    a
    s
    • 3
    • 2
  • b

    Big Chungus

    08/13/2019, 7:55 AM
    How can i set npm registry with kotlin frontend plugin?
    a
    l
    s
    • 4
    • 8
  • r

    robstoll

    08/13/2019, 8:15 AM
    did anybody run into a similar issue and knows a workaround? https://youtrack.jetbrains.com/issue/KT-33294
    a
    • 2
    • 2
  • t

    thana

    08/13/2019, 1:31 PM
    how can i catch anythin in javascript? i mean iin JS literraly everything is throwable but i can catch only
    Throwable
    • 1
    • 1
  • s

    sean

    08/13/2019, 1:37 PM
    Is there a way to generate
    ts.d
    or typescript definition off of compile to js?
    s
    t
    • 3
    • 3
  • t

    thana

    08/13/2019, 1:56 PM
    i just fixed an issue in our codebase where the browser complained that
    asDynamic()
    does not exist on
    tmp$
    . How is that even possible? shouldn't
    asDynamic()
    be inlined?
    a
    • 2
    • 5
  • h

    hallvard

    08/14/2019, 10:44 AM
    Known problem? I construct message objects for a messaging system with builder constructs. I first build an update, then use this update in a payload builder to send off over http. When this is compiled to JS, the same variable name is used over, which is fine by me, but since I use builders that return self (this) in a lot of functions, the variable changes contents before use, resulting in a classcast exception. I will post an example in a thread here.
    a
    • 2
    • 12
  • l

    looki

    08/14/2019, 3:38 PM
    Is it possible to create .kts files with JavaScript as the target?
    a
    r
    g
    • 4
    • 3
  • r

    rince

    08/14/2019, 3:38 PM
    I have a problem trying to call sockjs-client (https://github.com/sockjs/sockjs-client) from my kotlin code - I have used @file:JsModule("sockjs-client") and @JsName("SockJS") to define an external class / function for SockJS. But I either get Uncaught TypeError: SockJS is not a constructor or Uncaught TypeError: SockJS is not a function 🤔 (also I am not really good with javascript 😄 )
    b
    a
    • 3
    • 6
  • j

    Joffrey

    08/14/2019, 5:47 PM
    How can I access `kotlin-react-redux`'s functions? Each
    moduleKind
    configuration in Gradle gives me a different error: -
    default moduleKind
    or `moduleKind="umd"`: " When accessing module declarations from UMD, they must be marked by both @JsModule and @JsNonModule " - `moduleKind="plain"`: " Can't access function 'createStore' marked with @JsModule annotation from non-modular project " -
    moduleKind="commonjs"
    compiles the
    main
    sources fine, but then I get the following for tests:
    When accessing module declarations from UMD, they must be marked by both @JsModule and @JsNonModule
    Did I miss something? Am I required to define a
    moduleKind
    separately for tests? Where is it then?
    a
    • 2
    • 2
  • a

    Andrew K

    08/15/2019, 4:41 AM
    Without the interface, I get the string property as "string". Anyway around this or do I just have to nix the interface?
    t
    s
    • 3
    • 3
  • s

    spand

    08/15/2019, 11:35 AM
    Am I the only one with compile logs filled with
    Warning:Kotlin: '.../.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-common/1.2.2/8b54928fbb813408684911eb27d6afeb23c92a4b/kotlinx-coroutines-core-common-1.2.2.jar' is not a valid Kotlin Javascript library
    warnings
    r
    • 2
    • 1
  • s

    Soren Valle

    08/15/2019, 4:14 PM
    I am creating a
    object {}
    with any number of properties and functions that will be processed in a given way. I would like to mark the properties to make logical decisions about them in the processor. If I understand correctly, js annotations are not possible. Is there another way? What I need specifically is I need properties of the object to exist in the definition but not the final product. Potentially I could have
    val prop1: String = "value"  and val prop2: String = "value2"
    and I would like to include
    prop1
    but not
    prop2
    .
    a
    • 2
    • 2
  • s

    Sam Garfinkel

    08/15/2019, 8:08 PM
    Is there anyway to get the
    org.jetbrains.kotlin.js
    gradle plugin to run
    ts2kt
    automatically? Does it do this already?
    s
    s
    • 3
    • 8
  • f

    FalseHonesty

    08/18/2019, 10:41 PM
    Hey, I've got a question about the kotlin stdlib generated. I'm using the DCE tool to trim it down, however, this "new" stdlib is still using the basic
    Kotlin
    variable name. In my environment, I'd like to be able to use different versions of the stdlib, each containing the specific code it uses. To do this, I need to be able to control what the
    Kotlin
    variable is actually called. Is this possible?
    r
    • 2
    • 1
  • t

    thana

    08/20/2019, 8:41 AM
    how do i use the gradle frontend plugin nowadays? https://github.com/Kotlin/kotlin-frontend-plugin/blob/master/README.md looks a bit outdated and indeed, i am unable to use this plugin with kotlin 1.3.41 (
    Cannot add task 'processResources' as a task with that name already exists.
    ). Or maybe it's gotten deprecated and i do not need it anymore?
    b
    m
    • 3
    • 26
  • t

    thana

    08/20/2019, 1:55 PM
    when using the 1.3.41 js plugin, is there a way to pass a configu variable to the webpack process?
    s
    • 2
    • 4
  • s

    Soren Valle

    08/20/2019, 8:08 PM
    Has anyone set up js tests with the new kotlin-js plugin on linux?
    s
    • 2
    • 4
  • a

    ankushg

    08/21/2019, 3:03 AM
    Hi friends! In Kotlin 1.3.30, I had a setup as follows: -
    libA
    was a MPP that depended on
    stdlib
    using
    implementation
    -
    libB
    was a MPP which depended on
    libA
    and
    stdlib
    using
    implementation
    -
    libC
    was a Kotlin/JS project, depending on
    libA
    ,
    libB
    , and
    stdlib
    using
    compile
    I was able to build
    libC
    with
    kotlin-dce-js
    . I got a version of
    stdlib
    that contained the overlap that was used by all three libraries. I could also use
    runDceKotlinJs.keep
    to expose specific methods from
    libA
    ,
    libB
    and
    libC
    to be called from pure JS. After bumping to Kotlin 1.3.41 however (still using
    kotlin2js
    plugin), when I try to run
    :libC:runDceKotlinJs
    , I get error messages complaining that
    error: duplicate target file will be created for '/opt/projects/my-repo/libA/build/libs/libA-js-0.1.4.jar!lib/kotlin.js' and '/Users/amgupt01/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.41/55b92e441b0ea9cbf079c6452b41687f95571524/kotlin-stdlib-js-1.3.41.jar!kotlin.js'
    Any ideas? EDIT: I've tried using the newer
    org.jetbrains.kotlin.js
    plugin, as well as changing `libC`'s dependencies to be
    implementation
    instead of
    compile
    . Still no luck 😕
    b
    • 2
    • 7
  • s

    spierce7

    08/22/2019, 8:32 PM
    Super excited about Dukat guys. ts2kt had several errors on every single library I tried to convert, and if you guys are confident enough in it’s replacement that it will automatically convert ts libs to external declarations and import them, that sounds fantastic. This is exactly the kind of thing that kotlin-js needs to reduce headache and drive adoption.
    👍 5
    😉 1
    c
    • 2
    • 1
  • l

    linux_china

    08/23/2019, 4:20 AM
    Where to find kotlin-test-nodejs-runner 1.3.50?
    Generated package.json
    s
    x
    • 3
    • 6
  • x

    xlj44400

    08/23/2019, 8:43 AM
    kotlin js 1.3.50 project first build so slow?😅
    l
    • 2
    • 1
  • j

    Juanoterocas

    08/23/2019, 4:16 PM
    I want to migrate old Kotlin-frontend( 1.3.21) project to new 1.3.50, is there some steps to follow? btw how I can handle TypeScript Partial type?
    d
    a
    • 3
    • 2
  • g

    galex

    08/24/2019, 12:26 PM
    Hey all, can you please be supportive and +1 this feature? Thank youuuu! https://youtrack.jetbrains.com/issue/KT-32332
    👍 1
    r
    s
    • 3
    • 4
  • h

    hellman

    08/26/2019, 10:59 AM
    If I add coroutines to my project the resulting bundle is too big and webpack issues a warning in the JS console, even if I add the DCE plugin. Not sure what webpack configuration I need to fix that. Any suggestions?
    r
    b
    s
    • 4
    • 32
  • f

    fcosta

    08/26/2019, 1:44 PM
    Hey guys! I tried to upgrade my project to Kotlin 1.3.50 and the following development server configuration doesn’t seem to work anymore. Any hint where I can find the correct DSL for it?
    webpackTask {
                    runTask {
                        //todo: use dsl after KT-32016 will be fixed
                        devServer = new org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfigWriter.DevServer(
                                true, false, true, true, false,
                                8081,
                                ["/api": "<http://0.0.0.0:8082>"],
                                ["$projectDir/src/main/resources".toString()]
                        )
                    }
                }
    https://github.com/felipehjcosta/chat-app/blob/master/frontend/build.gradle#L26
    s
    • 2
    • 2
  • a

    ankushg

    08/27/2019, 12:48 AM
    Is anyone using the new built-in JS test runner that shipped with Kotlin 1.3.40+? I'm struggling to figure out how to get it to get it to give me JUnit-style XML test reports (which are CI-friendly), rather than only the HTML report.
    s
    • 2
    • 1
  • a

    ankushg

    08/27/2019, 4:32 AM
    Anyone have any pointers for writing a Gradle Plugin that finds methods or fields annotated with
    @JsName
    and automatically adds them to
    runDceKotlinJs.keep
    ? Keeping DCE Keep and JsName declarations in sync seems to be a consistent annoyance for me, but doesn't seem to be getting much love from Jetbrains... would love to be able to write it myself, but I'm a little lost on figuring it out.
    s
    • 2
    • 2
  • h

    hellman

    08/27/2019, 5:53 AM
    I’m assuming that
    generateExternals
    is the task that calls Dukat and generates code for the TypeScript definitions? I’m having problems debugging it. The task completes successfully, but no code is generated for the NPM package I’ve included (lit-element).
    s
    • 2
    • 4
Powered by Linen
Title
h

hellman

08/27/2019, 5:53 AM
I’m assuming that
generateExternals
is the task that calls Dukat and generates code for the TypeScript definitions? I’m having problems debugging it. The task completes successfully, but no code is generated for the NPM package I’ve included (lit-element).
s

snrostov

08/27/2019, 9:22 AM
This is a bug. There is
"typings": "lit-element.d.ts"
in
lit-element/package.json
, but currently we are searching for
types
key only. According to https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html,
typings
should be supported too. Please fill an issue in youtrack
Created https://youtrack.jetbrains.com/issue/KT-33549
h

hellman

08/27/2019, 1:54 PM
👍
Thanks!
View count: 2