Skip to content
Latchkey

Scala sbt "could not find implicit value" in CI

The compiler needed to supply an implicit argument and could not find a matching one in scope. It reports "could not find implicit value for parameter ...", naming the implicit type it was looking for.

What this error means

sbt compile fails with "[error] could not find implicit value for parameter X: T" or "no implicits found for parameter", pointing at the call that requires the implicit.

scala
[error] /src/main/scala/Json.scala:12:30: could not find implicit value for
[error] evidence parameter of type io.circe.Encoder[User]
[error]   val payload = user.asJson
[error]                              ^

Common causes

The required implicit instance is not imported

A typeclass instance (an Encoder, Ordering, ExecutionContext) exists but its providing import is not in scope at the call site.

No instance derives for the concrete type

The library can derive the implicit for some types but not yours, so the compiler finds no candidate to summon.

How to fix it

Bring the implicit into scope

  1. Read which implicit type the error names.
  2. Import the instance or its derivation from the providing package.
  3. Re-run sbt compile to confirm the implicit resolves.
Json.scala
import io.circe.generic.auto._

Provide an explicit instance

When no derivation fits, define the instance yourself so the compiler has a candidate.

Json.scala
implicit val userEncoder: Encoder[User] =
  Encoder.forProduct2("id", "name")(u => (u.id, u.name))

How to prevent it

  • Import typeclass instances explicitly where they are used.
  • Define instances for your own types instead of relying on broad auto-derivation.
  • Compile locally so missing implicits surface before CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →