Milad Khajavi Milad Khajavi - 1 year ago 77
Scala Question

linking error on parsing java.time.LocalDate in scalajs

When I want to parse LocalDate in scalajs, linking error occur:


here is the error message:

[error] Referring to non-existent method java.time.LocalDate$.parse(java.lang.CharSequence)java.time.LocalDate
[error] called from example.ScalaJSExample$$anonfun$myview$1.applyOrElse(scala.collection.immutable.List,scala.Function1)java.lang.Object
[error] called from example.ScalaJSExample$$anonfun$myview$1.applyOrElse(java.lang.Object,scala.Function1)java.lang.Object
[error] called from scala.concurrent.Future$class.$$anonfun$1(scala.concurrent.Future,scala.PartialFunction,scala.util.Try)java.lang.Object

but using java.time.LocalDate.of(2016,11,11) works without any error.

What is the problem?!

Answer Source

Because java.time.LocalDate.parse is not implemented. You might try another of the alternative libraries for java.time support, if one of them supports it. Otherwise, I guess you could contribute the implementation.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download