Skip to content
Latchkey

Scala sbt "not found: value/object X" in CI

scalac encountered a name with no binding in scope. "not found: value X" means an unresolved term; "not found: object X" means an unresolved module, typically a missing import or a class that was never compiled.

What this error means

sbt compile fails with "[error] ... not found: value X" or "not found: object X", pointing at the source line and column where the identifier appears.

scala
[error] /src/main/scala/App.scala:7:18: not found: value Logger
[error]   private val log = Logger(getClass)
[error]                     ^
[error] one error found

Common causes

A missing import for the symbol

The value or object is defined in another package and the source never imports it, so the name is unbound.

A dependency providing the symbol is absent

The library or subproject that defines the object is not on the compile classpath, so the import target does not exist.

How to fix it

Add the missing import

  1. Read the file and column the error points to.
  2. Import the value or object from its defining package.
  3. Re-run sbt compile to confirm the name now resolves.
App.scala
import com.typesafe.scalalogging.Logger

Add the dependency that provides it

If the symbol comes from a library, declare it so the import target is on the classpath.

build.sbt
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5"

How to prevent it

  • Let the editor add imports rather than relying on memory.
  • Declare every symbol-providing library in libraryDependencies.
  • Compile locally before pushing so unresolved names surface early.

Related guides

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