https://kotlinlang.org logo
#ktor
Title
# ktor
a

addamsson

08/26/2020, 8:51 AM
Is there anyone here who managed to get
watch
to work in Ktor? I've been trying for ages but it never works. Right now I get
Module function provided as lambda cannot be unlinked for reload
even though I copied the exact same code from the documentation site:
Copy code
fun main(args: Array<String>) {
    embeddedServer(
            Netty,
            watchPaths = listOf("mydir"),
            port = PORT,
            module = Application::module
    ).start(true)
}
What am I doing wrong?
as it turns out the
watch
doesn't work with an overloaded module function:
Copy code
@kotlin.jvm.JvmOverloads
fun Application.module(testing: Boolean = false)
is there a workaround for this?
m

Michael

08/26/2020, 8:59 AM
is the error a runtime or compile time error?
a

addamsson

08/26/2020, 9:09 AM
runtime
it only happens if my module function is overloaded
4 Views