sbt "not found: object" / "not found: value"
The Scala compiler reached a name it cannot resolve. The package, class, or value you referenced is not on the compile classpath, or the import is missing.
What this error means
Compilation stops with not found: object Foo or not found: value bar, pointing at the line where the unknown name appears. It is deterministic - the symbol simply is not visible.
[error] /src/main/scala/App.scala:7:8: not found: object cats
[error] import cats.effect.IO
[error] ^
[error] one error foundCommon causes
The dependency is missing or in the wrong scope
Referencing cats.effect without adding cats-effect to libraryDependencies, or adding it only to Test, leaves the object off the main compile classpath.
Missing import or wrong package path
The symbol exists but is in a package you did not import, or the package name was typed incorrectly.
Generated sources not produced yet
Code that depends on generated sources (protobuf, BuildInfo) fails if the generator task did not run before compile.
How to fix it
Add the dependency in the right scope
Declare the library on the compile classpath so the object resolves.
libraryDependencies += "org.typelevel" %% "cats-effect" % "3.5.4"Fix the import path
- Confirm the fully qualified package of the symbol from its docs.
- Add the matching
importat the top of the file. - Watch for case typos: Scala identifiers are case sensitive.
Ensure generators run first
Wire generated sources into Compile / sourceGenerators so they exist before compilation.
How to prevent it
- Keep dependency scopes correct (compile vs test).
- Let your IDE flag unresolved symbols before pushing.
- Run
sbt clean compilelocally on a fresh checkout.