I'm experiencing a weird exception which I couldn'...
# koin
e
I'm experiencing a weird exception which I couldn't fix:
Can't create bean Bean[class=connectors.PanthroClient] due to error: Cyclic dependency detected while resolving class kotlin.Function1
. Any hints off the top of your heads?
My code looks like this:
Copy code
typealias HttpHandler = (Request) -> Response

val stargazerModule: Module = applicationContext {

    provide("server") { Netty(getProperty("stargazer.rest-port", "8080").toInt()) as ServerConfig }

    provide("http.client") { OkHttp as HttpHandler }

    provide { PanthroClientImpl(getProperty("panthro.socket-address"), get("http.client")) as PanthroClient }

    provide("stargazer.rest-handler") {       newStargazerRestHandler(panthroClient = get()) as HttpHandler
    }
}
Looks like things like
(Request) -> Response
and
(String) -> Int
all get mapped to
kotlin.Function1
, so there's no way to differentiate them, right?
I'll have to create a container class then, I guess.
a
Hello @elifarley please open an issue on Koin's girhub, it will be easier to help you than looking on slack. Thanks