Hello, i'm struggling with Koin injection. I have ...
# koin
k
Hello, i'm struggling with Koin injection. I have the following code with the following error:
Copy code
fun Routing.leaderboard() {

    val service by inject<UserService>()

    get<LeaderboardResource.Top100> {
        service.getUserLeaderboard().map { leaderboard ->
            leaderboard.map { Leaderboard(it.first, it.second) }
        }.respond(HttpStatusCode.OK)
    }
}
Copy code
java.lang.IncompatibleClassChangeError: Found interface io.ktor.server.routing.Routing, but class was expected
	at org.koin.ktor.ext.RoutingExtKt.getKoin(RoutingExt.kt:74)
	at yesitskev.dota2.fantasy.features.leaderboard.LeaderboardResourceKt$leaderboard$$inlined$inject$default$1.invoke(RoutingExt.kt:76)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:83)
a
what jvm version are you using?