Is it currently possible to use ktor dev mode with...
# kotlin-toolchain
h
Is it currently possible to use ktor dev mode with kotlin-toolchain?
z
Setting
ktor: enabled
performs the following actions:
• Adds the `io.ktor.development=true`system property when running the app with`kotlin run`
kotlin-toolchain.org/latest/user-guide/builtin-tech/ktor
h
but it needs to rebuild no? how can we automatically rebuild with kotlin toolchain?
a
If you mean livereload mode, it's now broken in Kotlin Toolchain, as far as I remember because livereload server watches FS itself, and we while recompiling write classes one by one, livereload server see changes and start reloading mid-compilation and now you ended up with a broken state there is an issue in YouTrack for that you could follow
👍 1
additional note: it seems like, ktor dev server just debounce the changes, but we are just doing things in a slightly different order we will talk with ktor folks and ask them to provide an API for communicating that we're done, please start reloading instead of relying on unreliable debounce
h
Okay currently what I'm doing is just using gradle with ktor 3.4.3 to use auto-reload as specified here ktor.io/docs/server-auto-reload.html#…
a
This still appears broken. Toolchain does not auto-rebuild, and builds a JAR which I think defeats live reload as well. This should be documented more clearly so people do not go down the road of using toolchain for a KTOR app only to find a brick wall in development related to hot reload.
Please document this in toolchain in the ktor setting, and in ktor about not using toolchain if you want this to work.