carlosedp/zio-scalajs-stack

Error running Native Image binary for Scala 3 backend project

carlosedp opened this issue · 0 comments

Due to bugs in the compiler, the backend have been temporarily reverted to Scala 2.13 since Scala 3 doesn't play well with GraalVM Native Image yet.

The error is:

❯ /Users/cdepaula/repos/scala-playground/zio-scalajs-stack/out/backend/nativeImage.dest/backend
Exception in thread "main" scala.runtime.LazyVals$$anon$1
	at scala.runtime.LazyVals$.$init$$$anonfun$3(LazyVals.scala:18)
	at scala.Option.getOrElse(Option.scala:201)
	at scala.runtime.LazyVals$.<clinit>(LazyVals.scala:19)
	at zio.ZLayer.<clinit>(ZLayer.scala:42)
	at java.lang.Class.ensureInitialized(DynamicHub.java:525)
	at zio.ZLayer$Suspend$.apply(ZLayer.scala:437)
	at zio.ZLayer$.suspend(ZLayer.scala:667)
	at zio.ZLayer$.fromZIOEnvironment(ZLayer.scala:613)
	at zio.ZLayer$.<clinit>(ZLayer.scala:558)
	at zio.ZIOAppDefault.$init$(ZIOAppDefault.scala:43)
	at com.carlosedp.zioscalajs.backend.MainApp$.<clinit>(MainApp.scala:11)
	at com.carlosedp.zioscalajs.backend.MainApp.main(MainApp.scala)

Ref:
scala/scala3#13985
scala/scala3#9013
https://www.reddit.com/r/scala/comments/rzvkmi/graalvm_nativeimage_with_scala_3_reflection_hell/