Scala "value X is not a member of Y" in CI
The compiler resolved the receiver's type but that type has no member with the name you called. In CI this is usually a different dependency version, a missing extension-method import, or an implicit that is not in scope.
What this error means
scalac fails with "value X is not a member of Y" (for example a method the type does not declare) at the call site.
[error] /src/main/scala/Service.scala:20:14: value asJson is not a member of MyCase
[error] payload.asJson
[error] ^Common causes
A missing extension-method import
Methods added by a library (like asJson) come from an implicit or extension that must be imported; without the import the base type has no such member.
A version skew changed the API
CI resolved a version of the library where the method was renamed or removed, so the member no longer exists.
How to fix it
Import the extension that adds the member
- Find which import brings the method into scope.
- Add that import to the file.
- Recompile to confirm the member resolves.
import io.circe.syntax._ // adds .asJson
payload.asJsonAlign the dependency version with the code
If the method exists only in a specific version, pin that version so CI resolves the same API you compiled against locally.
libraryDependencies += "io.circe" %% "circe-generic" % "0.14.6"How to prevent it
- Keep extension-method imports next to the code that uses them.
- Lock dependency versions so the member surface matches locally and in CI.
- Review API changes in dependency release notes before upgrading.