https://kotlinlang.org logo
#koin-contributors
Title
# koin-contributors
v

Viktor Orlyk

04/21/2022, 12:08 PM
Hi, guys. I am relatively new to koin and ktor but this looks like there is some mismatching between ktor 2.0 and koin 3.2.0-beta-1. Maybe there is some more new version of docs instead of https://insert-koin.io/docs/reference/koin-ktor/ktor/ ? while trying to create extension fn run into next error.
Copy code
implementation("io.insert-koin:koin-ktor:$koin_version")
    implementation("io.insert-koin:koin-logger-slf4j:$koin_version")
Copy code
```import io.ktor.server.application.*
import org.koin.ktor.ext.Koin

fun Application.configureDependancyInjection() {
    install(Koin) {
        slf4jLogger()
        modules(helloAppModule)
    }
}
Copy code
```Type mismatch: inferred type is Koin.Feature but Plugin<TypeVariable(P), TypeVariable(B), TypeVariable(F)> was expected
doing something like
Copy code
package com.example.base

import io.ktor.server.application.*
import org.koin.ktor.ext.koin
import org.koin.logger.slf4jLogger

fun Application.configureDependancyInjection() {
    koin {
        slf4jLogger()
    }
}
result in next error maybe there is some dedicated guide to use it properly?
Copy code
<html>Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:<br/>public fun Application.koin(configuration: KoinAppDeclaration /* = KoinApplication.() -> Unit */): Koin defined in org.koin.ktor.ext
n

Nacho Ruiz Martin

04/21/2022, 12:25 PM
Hey! Yes, indeed, Koin is not yet prepared to work with Ktor 2.0. In the #koin channel, more dedicated to questions than this one, you can find that it is a WIP. You can either use Ktor 1.X until Koin 3.2 is released or use a custom Plugin as explained here: https://github.com/InsertKoinIO/koin/issues/1295
👍 1
a

arnaud.giuliani

04/21/2022, 1:23 PM
yep, work in progress to merge ktor 2.0
70 Views