kotlin-hands-on / jvm-js-fullstack

https://play.kotlinlang.org/hands-on/Full%20Stack%20Web%20App%20with%20Kotlin%20Multiplatform/
122 stars 149 forks source link

Unable to resolve `@KtorDsl` in latest version #18

Closed harrisonmetz closed 2 years ago

harrisonmetz commented 2 years ago

It seems that it is unable to resolve @KtorDsl in the latest branch here:

commit 70ecf4ad92b89942e33285abb1866c298977e56d (origin/master, origin/HEAD, master)
Author: Sebastian Aigner <sebastian.aigner@jetbrains.com>
Date:   Mon Jul 11 17:52:35 2022 +0200

    Update to Kotlin 1.7.10, Ktor 2.0.3

The code in question is this:

fun main() {
    embeddedServer(Netty, 9090) {
        routing {
            get("/hello") {
                call.respondText("Hello, API!")
            }
        }
    }.start(wait = true)
}
p1 p2

This causes the routing to not work so call.respondText is red in Intellij. However, the project does seem to build with Gradle.

I tried making a new project in Intellij and and that worked. I noticed that was using ktor 2.0.1 so I tried that here but it still failed.