Runtime error when using Shapeless > 2.3.3
See original GitHub issueI am getting a strange error at runtime, which I could not reproduce:
java.lang.NoClassDefFoundError: shapeless/ops/hlist$ZipWithKeys$$anon$158
[info] at com.byond.infinity.defs$ProgramResponse$anon$lazy$macro$25$1.inst$macro$1$lzycompute(defs.scala:93)
[info] at com.byond.infinity.defs$ProgramResponse$anon$lazy$macro$25$1.inst$macro$1(defs.scala:93)
[info] at com.byond.infinity.defs$ProgramResponse$.<clinit>(defs.scala:93)
Here is the line:
case class ProgramResponse(
id: UUID,
name: String,
description: String,
program: String,
dependencies: Dependencies,
created: Instant,
updated: Instant,
createdBy: Option[String],
updatedBy: Option[String]
)
object ProgramResponse {
implicit val decoder: Decoder[ProgramResponse] = deriveDecoder
implicit val encoder: Encoder[ProgramResponse] = deriveEncoder
}
final case class Dependencies(value: List[String]) extends AnyVal
object Dependencies {
implicit val decoder: Decoder[Dependencies] = Decoder[List[String]].map(Dependencies.apply)
implicit val encoder: Encoder[Dependencies] = Encoder[List[String]].contramap(_.value)
}
This only happens when I upgraded a dependency that used shapeless 2.3.5 (2.3.4 gives the same results).
Scala version: 2.13.5 Circe version: 0.13.0
Please help
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Shapeless error while trying trying to use PureConfig and ...
This error is because of conflicting shapeless library versions. Spark 3.1.2 ships with shapeless 2.3.3 whereas both these packages need shapeless 2.3.7.
Read more >milessabin/shapeless - Gitter
When I'm trying to start a spark-shell(spark 3.0.1 ) with a custom jar I'm getting this error java.lang.NoSuchMethodError: 'shapeless.
Read more >shapeless-2.3.3 released! - Miles Sabin
If so then updating your shapeless dependency to 2.3. 3 should resolve the issue.
Read more >Ammonite
Version 2.5.5. Ammonite lets you use the Scala language for scripting purposes: in the REPL or as scripts. ... com.chuusai::shapeless:2.3.3`, shapeless.
Read more >How to create a small json lib using antlr and shapeless
In this article i will show how antlr4 and shapeless can be used to create ... ErrorNode): Json = throw new RuntimeException("Parse error") ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Now that my project compiles on shapeless 2.3.7, I am getting a similar exception.
~I’ll try and put together a working example.~
UPDATE: my bad, all I needed was a clean rebuild.
tried with 2.3.7, still same result; and, sadly, I cannot reproduce on Scastie… N00b question: Is
sbt clean test
enough to do a clean rebuild?