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.
[error] /src/main/scala/App.scala:7:18: not found: value Logger
[error] private val log = Logger(getClass)
[error] ^
[error] one error foundCommon 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
- Read the file and column the error points to.
- Import the value or object from its defining package.
- Re-run
sbt compileto confirm the name now resolves.
import com.typesafe.scalalogging.LoggerAdd the dependency that provides it
If the symbol comes from a library, declare it so the import target is on the classpath.
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.