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
react
  • a

    Andromadus Naruto

    08/06/2022, 9:08 AM
    Hi, everyone. I would to get your opinions on using Kotlin/JS + Kotlin React Wrappers for enterprise grade web applications. I've been using Ktor for my server-side applications and Angular for most of my frontend apps. I believe I can benefit from a multiplatform solution using Kotlin Multiplatform. I'm thinking shared dtos, interfaces, business logic, DI, etc... for fast development and consistency in codebase. I'm also aware that JetBrains uses it internally for their apps. However I'm the only developer in the team and I have about 9 months to build a in-house solution with features like project management, CRM, ERP, User Management, Knowledge Base, Grouped Chatrooms, etc. Do you guys think it's a worthwhile investment long-term? I would like to learn from your experiences and insights. Thank you in advance 🙏🏾
    m
    c
    • 3
    • 6
  • w

    William Persall

    10/02/2022, 6:00 PM
    Has anyone ever written a wrapper for a JS libary? I was hoping to connect with someone willing to be a mentor with on that subject.
    b
    • 2
    • 3
  • g

    gammax

    10/08/2022, 7:22 AM
    Sharing this little news I contributed to ship: https://twitter.com/reactnative/status/1578332414145105921
  • f

    Florent Martin

    10/21/2022, 7:11 AM
    I am trying to use kotlin-react-query, has anybody some kotlinJS examples? Thx in advance
    t
    • 2
    • 3
  • m

    Magnus Nilsson

    10/24/2022, 5:19 PM
    Is there a way to use
    styled()
    from mui (https://mui.com/system/styled) using kotlin-wrappers? I tried this but it does not seem to work (I guess because the imported styled is
    emotion.styled.styled
    ).
    val MyBox = Box.styled { props, _ ->
        <http://props.sx|props.sx> {
            display = responsive(
                <http://Breakpoint.sm|Breakpoint.sm> to Display.none,
                Breakpoint.md to Display.flex,
            )
            flexGrow = responsive(
                Breakpoint.md to number(1.0),
                Breakpoint.lg to number(3.0),
            )
        }
    }
    t
    • 2
    • 3
  • j

    Joffrey

    11/06/2022, 3:37 PM
    I'm getting back to kotlin react wrappers after quite some time. Trying to update dependencies, I want to migrate to the new DSL and APIs (
    RBuilder
    ->
    ChildrenBuilder
    ), but I find no migration guide. Where can I find information apart from the very succinct summary from the
    CHANGELOG.md
    ? For instance, how should I define the react entrypoint now? I used to use:
    val store = initRedux()
    
    render(rootElement) {
        provider(store) {
            application()
        }
    }
    With
    application
    being an extension function on
    RBuilder
    . However I get a deprecation warning on
    render()
    , but with no
    ReplaceWith
    nor explanation about what I should use instead. Any hints?
    t
    • 2
    • 5
  • s

    Sam Gammon

    11/10/2022, 4:07 AM
    hello kotlin react friends
  • s

    Sam Gammon

    11/10/2022, 4:07 AM
    i am a big fan
  • s

    Sam Gammon

    11/10/2022, 4:07 AM
    i am writing a framework partially based on the wrappers libs, so i figured i would join 🙂
  • r

    Robert Jaros

    11/11/2022, 1:43 PM
    Why do we have
    dom.html.*
    external classes? Is
    dom.html.HTMLDivElement
    the same as
    org.w3c.dom.HTMLDivElement
    ? Can I safely cast one to the other? @turansky
    t
    • 2
    • 4
  • h

    Haruki

    11/14/2022, 7:10 PM
    Hi, I am doing a multiplatform-full-stack-app tutorial (https://kotlinlang.org/docs/multiplatform-full-stack-app.html#build-the-user-interface). And I would like to add fancy icons. I usually use Font Awesome for icons on static HTML, and I am wondering if it's possible to add Font-Awesome icons to the code below. I am assuming we can implement it by adding the class attribute to an i tag, like this:
    i("fa-light fa-trash-can"){}
    as we implement it on static HTML by
    <i class="fa-light fa-trash-can"></i>
    . However, this doesn't work since it seems like the way I added the class attribute doesn't work. I would like to know how you usually add fancy icons and class attributes on kotlin react.
    import react.*
    import kotlinx.coroutines.*
    import react.dom.html.ReactHTML.h1
    import <http://react.dom.html.ReactHTML.li|react.dom.html.ReactHTML.li>
    import react.dom.html.ReactHTML.ul
    
    
    
    val App = FC<Props> {
    
        h1 {
            +"Full-Stack Shopping List"
        }
    }
    t
    • 2
    • 3
  • d

    Dmitriy Malayev

    11/17/2022, 8:10 PM
    I'm stuck on this problem. Can anyone help? Before clicking, After Clicking, Code Snippet. (utilizing mui)
    p
    a
    s
    • 4
    • 5
  • p

    Piotr Krzemiński

    11/18/2022, 2:20 PM
    I’m getting:
    Type mismatch: inferred type is org.w3c.dom.Element but dom.Element was expected
    with this code:
    fun main() {
        createRoot(document.createElement("div").also { document.body!!.appendChild(it) })
            .render(App.create())
    }
    when bumping from kotlin-wrappers pre.430 to pre.431. What’s the new API? could you update kotlin-mui-showcase?
    b
    t
    a
    • 4
    • 29
  • p

    Partho Paul

    11/19/2022, 11:55 AM
    Hi, can someone please tell me how to deploy my app in prod using kubernetes? I’ve added the tasks for creating
    browserProductionWebpack
    , but not able to figure out how to start the app.
    p
    l
    • 3
    • 3
  • l

    Leon

    11/23/2022, 2:09 PM
    Does anyone have an experience in implementation of
    React.lazy
    in kotlin/JS? Thank you for any advise and providing reference.
    d
    c
    • 3
    • 5
  • m

    Mark Vogel

    11/29/2022, 9:33 PM
    I'm attempting to convert some React JS code to Kotlin/JS and, being inexperienced with React, I'm having issues figuring out how to do so. Does anyone know how to convert this kind of
    div
    to Kotlin React? I can post the package.json dependencies if needed as well
    return (
        <div
          style={
            isDraggedOver
              ? {
                  border: "dashed 2px #abcdef",
                  borderRadius: "5px",
                  minHeight: "5rem",
                  boxSizing: "border-box",
                  gridColumn: `span ${size}`
                }
              : { gridColumn: `span ${size}` }
          }
          onDrop={onDrop}
          onDragEnter={onDragEnter}
          onDragLeave={onDragLeave}
          onDragOver={(e) => e.preventDefault()}
        >
          {!isDraggedOver && children}
        </div>
      );
    t
    • 2
    • 6
  • m

    Mark Vogel

    11/30/2022, 4:34 PM
    Does anyone know what the Kotlin analog to these
    react-icon
    components is?
    import { AiOutlineClose } from "react-icons/ai";
    import { FiMinimize2 } from "react-icons/fi";
    
    <FiMinimize2 className="rounded-circle hand-style" color="white" onClick={() => { handleTriggerClick(index) }} />
    <AiOutlineClose className="rounded-circle" color="white" />
    Perhaps using MUI?
    c
    • 2
    • 1
  • p

    Piotr Krzemiński

    12/01/2022, 1:46 PM
    is there some work planned around [KT-49610] KJS: Allow unit-testing React components ? I pretty much like using Kotlin/JS + React, but no ability to test the components is a major disadvantage when trying to convince my colleagues to actually use it wider in the company
    r
    • 2
    • 10
  • d

    Dmitriy Malayev

    12/12/2022, 4:34 PM
    Hello, I have a NavigationBar component and a Control Center page, my Control Center has the NavBar imported. How do I adjust the content of the window to adjust when the nav bar is open?
  • l

    Leon

    12/20/2022, 3:15 PM
    I am now trying to integrate the
    react-redux
    wrapper for my project. I am referring this example project. But in the
    main.kt
    file, I noticed that the
    provider
    component is
    RBuilder
    . But I am using
    react.FC
    component from
    kotlin-react
    wrapper. Can anyone please let me know how to place
    provider
    component with my
    store
    prop inside
    createRoot(container).render(//root FC component)
    ?
    import browser.document
    import react.create
    import react.dom.client.createRoot
    
    fun main() {
        val container = document.getElementById("root") ?: error("Couldn't find root container!")
        createRoot(container).render(AppRouter.create{})
    }
    My
    main.kt
    file looks like this But I couldn’t put
    provider
    component..
    t
    • 2
    • 1
  • c

    Cheick Kante

    12/28/2022, 8:32 PM
    Hi, Does anybody know how to get React-Markdown to work with remark plugins ? my markdown component looks like this, and it works np
    @file:JsModule("react-markdown")
    @file:JsNonModule
    package <http://components.blog|components.blog>
    
    
    import react.ComponentClass
    import react.Props
    import react.PropsWithChildren
    
    @JsName("default")
    external val ReactMarkdown: ComponentClass<MarkdownProps>
    
    external interface MarkdownProps : PropsWithChildren{
        var remarkPlugins : Array<dynamic> 
    }
    and my remark file looks like (but won't get picked up by react-markdown)
    @file:JsModule("remark-gfm")
    @file:JsNonModule
    
    package <http://components.blog|components.blog>
    
    @JsName("default")
    external val RemarkGfm: dynamic
    I hook them up as below, and as stated earlier, I get the rendered content however remark does not get applied.
    ReactMarkdown {
        remarkPlugins = arrayOf(RemarkGfm)
    
        +content
    }
    t
    • 2
    • 3
  • s

    Sam Gammon

    01/01/2023, 2:50 AM
    Hello :kotlin: friends, What if Node were more than just JS? To celebrate the new year, I am pleased to share a new project called Elide, a new server runtime, like Node or Deno, but polyglot, written in Kotlin and based on GraalVM. We are in alpha and very open to early feedback and contributions for anyone interested, over in #framework-elide 🥳 You can do wild things with it, like fast React SSR in Micronaut or Spring. Guest language support is starting with JS, but there are plans to integrate other languages like Python, Ruby, and Rust/Go/etc. via LLVM. Of course,
    native-image
    is supported out of the box. • 🚀 Trying it out
    curl -sSL --tlsv1.2 dl.elide.dev/cli/install.sh | bash -s -
    👆 the one liner works on Darwin (amd64/arm64), and Linux (amd64) so far.
    If you prefer NPX:
    npx @elide-dev/elide@alpha shell
    :kotlin-intensifies-purple: Building Kotlin apps with it • Elide can be used as a plain library with a regular Micronaut server, and Ktor support is on the way. There are Maven artifacts in a custom repository which is easy to use during the alpha; you can see a sample here. • :gradle: Gradle plugin You can easily install the Gradle plugin to build your frontend assets and your Kotlin/JS, and package it into your server binary. It will handle building for SSR and CSR both, so you can easily switch between browser rendering modes. Check it out here. Maven and Bazel support are planned. • 🖥️ Using the shell
    elide shell
    drops you into a shell just like Node (see attached screenshot), the difference being the
    URL
    class we're using here is implemented in Kotlin, backed by the road-tested power of Micronaut, KotlinX, Netty, and the Java standard library. It has simply been adapted for use in JavaScript, according to the WhatWG URL Spec. • :js: Use Kotlin/JS or regular Node stack Elide packages and consumes your JS/TS with built-in support for
    esbuild
    , so you can use a standard Node toolchain or the Kotlin/JS stack. • 💨 Super fast React SSR Because Elide is basically Kotlin with a super-fast JS runtime attached, it can do JS SSR without leaving the JVM. This can soon be drop-in compatible with many React apps. You can see a live sample here to confirm it is fast and server-rendered. The code for that sample is pasted below to show how simple it is to call back and forth between Kotlin and your React app:
    @Page class Index : PageWithProps<YourProps>(YourProps.serializer()) {
    
        // Serve React SSR.
        @Get("/") suspend fun indexPage(request: HttpRequest<*>) = ssr(request) {    // 1: tell the server we're going to do SSR for this request
          head {
            title { +"Hello, Elide!" }
            stylesheet("/styles/base.css")
            stylesheet("/styles/main.css")
            script("/scripts/ui.js", defer = true)   // <-- 2: serve the CSR bundle so it can hydrate the react SSR response
          }
          body {
            injectSSR(this@Index, request)    // <-- 3: execute the JS VM to produce the SSR response, and splice it into the server response
          }
        }
    
    }
    • 🐙 Contributors needed The future of software is much more polyglot than today's paradigm: developers love to fight about frameworks, but at the end of the day, we're all writing code, and eliminating barriers between languages means easier collaboration and more value for all of us. It shouldn't be a Node vs. The World or a Rust vs. The World argument; we should get to pick and pull the best code we want from anywhere and use it to build our apps, especially from a multi-platform language like Kotlin. This runtime and framework are designed for that future. *If you agree, join us and make a dent in the universe*; you'll have a chance to be impactful and shape a brave new idea from the ground up. • 🙏 Thank you We chose Kotlin because of the fantastic community. 2023 will be a massive year for Kotlin, and we think that betting the farm on it is reasonable and smart. We are super excited about what JetBrains and Kotlin have in store for us with K2, context receivers, value classes... just so much to look forward to. Cheers and happy new year, Kotlin devs, :kotlin-intensifies-purple: sam Posted in #feed
  • s

    spierce7

    01/01/2023, 6:04 PM
    My team has recently made the jump from using typescript for our node.js servers to instead using Kotlin, and it's been a hit so far, so now we're investigating the tradeoffs of using Kotlin also for our web UI layer. Can anyone speak to the trade-offs of using Kotlin + React for Web UI vs just using typescript?
    t
    b
    a
    • 4
    • 16
  • w

    Wietlol

    01/01/2023, 11:18 PM
    I have a problem and am not entirely sure what my options are to solve it. I have a Kotlin/JS react project and am trying to use a library that defines a particular component. This library has an @types/lib type declaration package, but dukat fails to generate the externals due to a StackOverflowError. Downloading the index.d.ts and running dukat via the cli doesnt give this error, but it doesnt understand how to handle the react bindings and generates externals with wrong type names. Defining the definitions myself is very difficult as it is a very big library. (index.d.ts is roughly 5000 lines long) What I think I want is some way to make dukat work, or have some js/ts source code that acts as a bridge between the kotlin and external js code, where I can define a small type definition only for my purposes
    s
    t
    • 3
    • 9
  • d

    Dirk

    01/02/2023, 8:29 PM
    Hi everyone, we want to create a React SPA in Kotlin and want to use the Antd components. Has anyone created wrappers for this for the current version already?
    t
    • 2
    • 4
  • a

    andylamax

    01/03/2023, 1:30 AM
    data classes on kotlin/js work upto a point. If all you do is access the properties, then you will generally get away with a lot. Once you start calling methods (i.e. copy, componentN, toString) on them, you'll start getting a lot of undefined. In all fairness, it is bad practice anyway for state values to have methods. All in all, if you are using data classes just for that holding data (which is what they are for), you do not need to go for interfaces, Unless you are doing class based components
    s
    • 2
    • 1
  • l

    Luc Girardin

    01/10/2023, 9:35 PM
    After upgrading to Kotlin 1.8.0 (together with kotlin-wrappers), I get the following errors:
    Module not found: Error: Can't resolve '@mui/system' in '/Users/luc/kotlin/macrofocus/build/js/node_modules/@mui/x-date-pickers/MonthPicker'
    Module not found: Error: Can't resolve '@mui/system/Box' in '/Users/luc/kotlin/macrofocus/build/js/packages/macrofocus-eflux-app/kotlin'
    Any idea what could be the cause and a possible fix?!?
    t
    a
    • 3
    • 3
  • s

    Salman

    01/11/2023, 1:15 PM
    Hi everyone, I am trying to implement mui table and my page has now 500 lines of code, the page is very slow, inspection sometimes block my IDE, red warnings are staying even if I have corrected them for enough seconds(more than 30 to 40 and sometimes more), compilation time is in minutes after every change, the pages which do not use mui table seems to work fine for now, is anyone facing this issue?
    t
    • 2
    • 5
  • d

    Dirk

    01/18/2023, 2:16 PM
    Hello I seem to have a problem understanding the state hook. See the following screenshot: I have a state variable fachgutachterListen that is set after an API call under 1. The components is re-rendered with the new data. Data changes are transmitted from the server via websocket (3). When a changed data set is sent, the lambda for the data change in 2 is called. Now I have the problem that the state here is zero again as it was initially and does not have the current state, which is also displayed in the component. It is not clear to me where my error lies here, so that the current data can also be queried in 2, so that this can then be synchronised with the server change. Can anyone give me a hint as to where my error lies?
    t
    • 2
    • 9
  • b

    Begum Turan

    01/20/2023, 2:45 PM
    Hi everyone, I am newbie to Kotlin. I am trying to make "clock" in front end React, backend side will be Kotlin. The front part is not rendering on the web page. What might be the issue? Attached my code. I appreciate for any help
    c
    • 2
    • 33
Powered by Linen
Title
b

Begum Turan

01/20/2023, 2:45 PM
Hi everyone, I am newbie to Kotlin. I am trying to make "clock" in front end React, backend side will be Kotlin. The front part is not rendering on the web page. What might be the issue? Attached my code. I appreciate for any help
c

CLOVIS

01/20/2023, 5:17 PM
Do you have a
main
function client-side? You say it's "not rendering", what do you see exactly, is there an error message in the console?
Other than that, your code looks ok 👍
b

Begum Turan

01/20/2023, 5:45 PM
There is a main function running on client side. This is my guess. I might be wrong. How can I structure the files? I might structure the files wrong. Attach you can see the structure of files. I apprecaite for your help!
FAILURE "No matched subtrees found" @ /
this is what I am seeing in console
c

CLOVIS

01/21/2023, 7:56 PM
What does your
index.html
look like?
(your index.html would make more sense in jsMain than commonMain, but I don't think that causes the issue)
b

Begum Turan

01/22/2023, 11:00 PM
image.png
I still can not find the issue where i am doing wrong
this is the entire project
image.png
c

CLOVIS

01/23/2023, 8:49 AM
That yellow background doesn't look good. If you hover on it, there's probably some kind of message
What's your index.js? I don't have that
For me, it's
<project-name>-<module-name>.js
, for example https://gitlab.com/opensavvy/decouple/-/blob/main/demo/web/src/main/resources/index.html#L12
b

Begum Turan

01/23/2023, 3:34 PM
this is my index.js look like
When I hover it, it was saying embedded server should reference top level of application
I do not think this is a problem, because my back end is fully working
I am testing whether server is working or not by POSTMAN. I can see the clock is constantly updating in Postman. I assume the problem is somewhere in index.html or index.js
because it does not render anything on the browser
c

CLOVIS

01/23/2023, 4:22 PM
Ah, yeah, the server is because the Ktor devs want you to write it like this: https://gitlab.com/opensavvy/formulaide/-/blob/main/backend/src/main/kotlin/Backend.kt#L25 Indeed it's just an IDEA warning, it has no behavior
You never import your Kotlin code in your index.html, so it is never executed
You should import the generated JS file, e.g. https://gitlab.com/opensavvy/decouple/-/blob/main/demo/web/src/main/resources/index.html#L12
to know the exact name of the file, it's in
build/js/packages/<module name>
b

Begum Turan

01/23/2023, 5:57 PM
<script src="clockdeneme1.js"></script>
should it be like that
U11ntitled.png
When i changed it , it is still not rendering anything
c

CLOVIS

01/23/2023, 6:43 PM
Can you add a
println
at the start of your main and check the console to see if it gets executed at all?
I think
type="module"
is necessary
b

Begum Turan

01/23/2023, 7:45 PM
ssss.png
I can not see the println neither
I also send it to you, I am trying to find where I am doing wrong, I still can not figure it out
clockdeneme1.zip
clockdeneme1.zip
View count: 20