0

I'm trying to following the quickstart guide here https://lihaoyi.github.io/upickle-pprint/upickle/

Have set the dependency

"com.lihaoyi" %%% "upickle" % "0.3.6",

but the basics seem to fail:

scala> import upickle.default._

import upickle.default._

scala> write(1)       
java.lang.ClassCastException: java.lang.Double cannot be cast to scala.scalajs.js.Any
  at upickle.json.package$.write(package.scala:38)
  at upickle.Types$class.write(Types.scala:125)
  at upickle.default$.write(Api.scala:25)
  ... 35 elided
user48956
  • 14,850
  • 19
  • 93
  • 154

1 Answers1

4

If you're using it in the REPL, you should use the non-scala.js version of the dependency:

"com.lihaoyi" %% "upickle" % "0.3.6",

Because the REPL runs on Scala-JVM, not Scala.js

Li Haoyi
  • 15,330
  • 17
  • 80
  • 137
  • Love the navigation template on e.g. https://lihaoyi.github.io/upickle-pprint/upickle/#CustomPicklers . Where is it from? – Martin Senne Nov 07 '15 at 12:23