ScalaJs + ZIO:程序适用于 sbt 1.2.8 但不适用于 >= 1.3

ScalaJs + ZIO: Program works with sbt 1.2.8 but not >= 1.3

我正在尝试 scala.js 使用 zio 使用示例应用程序 https://github.com/wongelz/zio-scalajs-solarsystem

当我将 sbt 版本从 1.2.8 更新到 1.3.13 或 1.4.4 时,我收到以下错误:

[error] Referring to non-existent method java.time.LocalTime$.NANOS_PER_SECOND()long
[error]   called from private java.time.LocalDateTime.plusWithOverflow(java.time.LocalDate,long,long,long,long,int)java.time.LocalDateTime
[error]   called from java.time.LocalDateTime.plusNanos(long)java.time.LocalDateTime
[error]   called from java.time.LocalDateTime.plus(long,java.time.temporal.TemporalUnit)java.time.LocalDateTime
[error]   called from java.time.LocalDateTime.plus(long,java.time.temporal.TemporalUnit)java.time.temporal.Temporal
[error]   called from java.time.temporal.ChronoUnit.addTo(java.time.temporal.Temporal,long)java.time.temporal.Temporal
[error]   called from java.time.OffsetDateTime.plus(long,java.time.temporal.TemporalUnit)java.time.OffsetDateTime
[error]   called from java.time.OffsetDateTime.plus(long,java.time.temporal.TemporalUnit)java.time.temporal.Temporal
[error]   called from java.time.Duration.addTo(java.time.temporal.Temporal)java.time.temporal.Temporal
[error]   called from java.time.OffsetDateTime.plus(java.time.temporal.TemporalAmount)java.time.OffsetDateTime
[error]   called from private zio.Schedule$.$anonfun$fixed(scala.Option,java.time.OffsetDateTime,long,java.time.Duration,long,scala.runtime.LazyRef)zio.Schedule$Decision
[error]   called from private zio.Schedule$.$anonfun$fixed(scala.Option,long,java.time.Duration,long,scala.runtime.LazyRef,java.time.OffsetDateTime,java.lang.Object)zio.ZIO
[error]   called from private zio.Schedule$.loop(scala.Option,long,long,java.time.Duration,scala.runtime.LazyRef)scala.Function2
[error]   called from zio.Schedule$.fixed(java.time.Duration)zio.Schedule
[error]   called from private SolarSystemExample$.$anonfun$run(SolarSystemExample$SolarSystem)zio.ZIO
[error]   called from SolarSystemExample$.run(scala.collection.immutable.List)zio.ZIO
[error]   called from private zio.App.$anonfun$main([java.lang.String)zio.ZIO
[error]   called from zio.App.main([java.lang.String)void
[error]   called from SolarSystemExample$.main([java.lang.String)void
[error]   called from static SolarSystemExample.main([java.lang.String)void
[error]   called from core module module initializers
[error] involving instantiated classes:
[error]   java.time.LocalDateTime
[error]   java.time.temporal.ChronoUnit
[error]   java.time.OffsetDateTime
[error]   java.time.Duration
[error]   zio.Schedule$
[error]   SolarSystemExample$

为什么会出现这个错误?我应该在哪里举报?

回答我自己的问题(对于任何遇到同样问题的人):

确保您的类路径中没有 scalajs-java-time (1.0.0) 作为依赖项。 这是一个不完整的库,如果在 scala-java-time 之前选择它,您将收到问题中发布的错误。

发生此错误的原因是,至少在我的系统上,类路径的顺序从 sbt 1.2.8 更改为 sbt 1。 3.x,这导致 scalajs-java-time 库在 scala-java-time 之前被选中,从而导致

Referring to non-existent method java.time.LocalTime$.NANOS_PER_SECOND()long

错误