47degrees / case-classy

configuration with less hassle
http://47deg.github.io/case-classy/
Apache License 2.0
68 stars 8 forks source link

Referring to non-existent method classy.generic.derive.MkDecoder$.mkDecoderHList #71

Open prayagupa opened 6 years ago

prayagupa commented 6 years ago

with following dependencies,

name := "upd-frontend"

enablePlugins(ScalaJSPlugin)

version := "0.1"

scalaVersion := "2.12.6"

scalaJSUseMainModuleInitializer := true

libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "0.9.5"

libraryDependencies += "org.querki" %%% "jquery-facade" % "1.2"

// required
libraryDependencies += "com.47deg" %% "classy-core"            % "0.4.0"

// at least one required
libraryDependencies += "com.47deg" %% "classy-config-typesafe" % "0.4.0"
libraryDependencies += "com.47deg" %% "classy-config-shocon"   % "0.4.0"

libraryDependencies += "com.47deg" %% "classy-generic"         % "0.4.0"

libraryDependencies ++= Seq("com.chuusai" %% "shapeless" % "2.3.3")

I could not compile to JS

    import classy.generic._
    import classy.config._

    case class Env(uri: String, heartbeatResource: String, handoffResource: String)
    case class ApplicationConfig(dev: Env)

    import com.typesafe.config.Config
    val decoder1 = deriveDecoder[Config, ApplicationConfig]

    val config: Either[DecodeError, ApplicationConfig] = decoder1.fromString("""{
                          |  dev {
                          |      uri = "uri"
                          |      heartbeatResource = hb""
                          |      handoffResource = "hr"
                          |  }
                          |}
                          |""")

The stack-trace is

[error] Referring to non-existent method classy.generic.derive.MkRead$.mkReadNested(classy.Read,shapeless.Lazy)classy.generic.derive.MkRead
[error]   called from UpdFrontend$anon$mkDecoderGeneric$macro$22$1.inst$macro$7$lzycompute()classy.generic.derive.MkRead
[error]   called from UpdFrontend$anon$mkDecoderGeneric$macro$22$1.inst$macro$7()classy.generic.derive.MkRead
[error]   called from UpdFrontend$anon$mkDecoderGeneric$macro$22$1.$$anonfun$inst$macro$5$1()classy.generic.derive.MkRead
[error]   called from UpdFrontend$anon$mkDecoderGeneric$macro$22$1.inst$macro$5$lzycompute()classy.generic.derive.MkDecoder
[error]   called from UpdFrontend$anon$mkDecoderGeneric$macro$22$1.inst$macro$5()classy.generic.derive.MkDecoder
[error]   called from UpdFrontend$.main([java.lang.String)scala.Unit
[error]   called from core module module initializers
[error] involving instantiated classes:
[error]   UpdFrontend$anon$mkDecoderGeneric$macro$22$1
[error]   UpdFrontend$
[error] Referring to non-existent method classy.generic.package$.deriveDecoder(classy.generic.derive.MkDecoder)classy.Decoder
[error]   called from UpdFrontend$.main([java.lang.String)scala.Unit
[error]   called from core module module initializers
[error] involving instantiated classes:
[error]   UpdFrontend$
[error] org.scalajs.core.tools.linker.LinkingException: There were linking errors
[error]     at org.scalajs.core.tools.linker.frontend.BaseLinker.linkInternal(BaseLinker.scala:160)
[error]     at org.scalajs.core.tools.linker.frontend.BaseLinker.linkInternal(BaseLinker.scala:108)
[error]     at org.scalajs.core.tools.linker.frontend.LinkerFrontend.$anonfun$link$3(LinkerFrontend.scala:63)
[error]     at org.scalajs.core.tools.logging.Logger.time(Logger.scala:28)
[error]     at org.scalajs.core.tools.logging.Logger.time$(Logger.scala:26)
[error]     at org.scalajs.sbtplugin.Loggers$SbtLoggerWrapper.time(Loggers.scala:7)
[error]     at org.scalajs.core.tools.linker.frontend.LinkerFrontend.link(LinkerFrontend.scala:62)
[error]     at org.scalajs.core.tools.linker.Linker.$anonfun$link$1(Linker.scala:52)
[error]     at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error]     at org.scalajs.core.tools.linker.Linker.guard(Linker.scala:69)
[error]     at org.scalajs.core.tools.linker.Linker.link(Linker.scala:50)
[error]     at org.scalajs.core.tools.linker.ClearableLinker.$anonfun$link$1(ClearableLinker.scala:52)
[error]     at org.scalajs.core.tools.linker.ClearableLinker.$anonfun$link$1$adapted(ClearableLinker.scala:52)
[error]     at org.scalajs.core.tools.linker.ClearableLinker.linkerOp(ClearableLinker.scala:63)
[error]     at org.scalajs.core.tools.linker.ClearableLinker.link(ClearableLinker.scala:52)
[error]     at org.scalajs.sbtplugin.ScalaJSPluginInternal$.$anonfun$scalaJSStageSettings$11(ScalaJSPluginInternal.scala:315)
[error]     at sbt.util.FileFunction$.$anonfun$cached$1(FileFunction.scala:73)
[error]     at sbt.util.FileFunction$.$anonfun$cached$4(FileFunction.scala:147)
[error]     at sbt.util.Difference.apply(Tracked.scala:313)
[error]     at sbt.util.Difference.apply(Tracked.scala:293)
[error]     at sbt.util.FileFunction$.$anonfun$cached$3(FileFunction.scala:143)
[error]     at sbt.util.Difference.apply(Tracked.scala:313)
[error]     at sbt.util.Difference.apply(Tracked.scala:288)
[error]     at sbt.util.FileFunction$.$anonfun$cached$2(FileFunction.scala:142)
[error]     at org.scalajs.sbtplugin.ScalaJSPluginInternal$.$anonfun$scalaJSStageSettings$10(ScalaJSPluginInternal.scala:320)
[error]     at sbt.std.Transform$$anon$3.$anonfun$apply$2(System.scala:44)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:64)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.Execute.work(Execute.scala:266)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]     at java.lang.Thread.run(Thread.java:748)
[error] (compile:fastOptJS) org.scalajs.core.tools.linker.LinkingException: There were linking errors
[error] Total time: 22 s, completed Jul 13, 2018 12:04:19 PM