SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
Scala New Added 19 September 2026

Scala: could not find implicit value for parameter

The compiler could not supply an implicit argument, usually because the instance exists but is not in scope, or because the type it was defined for is slightly different from the one being summoned. Libraries such as Circe and Play JSON report a missing Encoder or Format this way when the real cause is a field type with no instance of its own.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
// The instance has to be in implicit scope: import it, or put it in the companion
import io.circe.generic.auto._        // derives encoders for case classes
import scala.concurrent.ExecutionContext.Implicits.global

// Better: define it in the companion object, where the compiler always looks
case class User(id: Long, joined: java.time.Instant)
object User {
  implicit val encoder: io.circe.Encoder[User] = io.circe.generic.semiauto.deriveEncoder
}

// Ask the compiler which instance it is missing, one type at a time
implicitly[io.circe.Encoder[java.time.Instant]]

// The nested type is usually the real gap: derivation cannot invent it
implicit val instantEnc: io.circe.Encoder[java.time.Instant] =
  io.circe.Encoder.encodeString.contramap(_.toString)

// Scala 3 renames the concept but not the cause
// given Encoder[User] = deriveEncoder
// scalacOptions += "-Xlog-implicits"   // prints why a candidate was rejected

How to diagnose Scala errors

Scala's most distinctive error class is binary incompatibility: libraries are published per Scala major version, and mixing artifacts built for different versions produces confusing "not a member of" or NoSuchMethodError failures. The %% operator in sbt exists precisely to append the right suffix, and most unresolved-dependency errors are a % where %% was needed.

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Check the Scala version suffix on every dependency. Use %% for Scala libraries and plain % only for Java ones.
  2. Run sbt evicted to list dependencies that were evicted by version conflict. A frequent source of runtime NoSuchMethodError.
  3. Use sbt dependencyTree to see the resolved graph and locate the transitive dependency pulling in an old version.
  4. For inference failures, add explicit type annotations at the boundary rather than at the error site; inference failures usually propagate from further up.
  5. Clear stale state with sbt clean and remove ~/.ivy2/cache or ~/.cache/coursier entries only for the specific failing artifact.

Tools worth reaching for

  • sbt evicted
  • sbt dependencyTree
  • coursier resolve
  • scalac -explain
  • MiMa (binary compat checks)

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

docs.scala-lang.org docs.scala-lang.org

Related Scala errors

See all 10 Scala errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.