lihaoyi / workbench-example-app

An example application written in ScalaJS using scala-js-dom and scala-js-workbench
204 stars 109 forks source link

todomvc compilation problem: This version (0.5.5) of Scala.js IR is not supported. #22

Closed tomjridge closed 9 years ago

tomjridge commented 9 years ago

Any suggestions? (I know very little scala and am not too familiar with sbt).

Full error:

java.io.IOException: This version (0.5.5) of Scala.js IR is not supported. Supported versions are: 0.5.0, 0.5.2, 0.5.3
    at scala.scalajs.ir.InfoSerializers$Deserializer.readHeader(InfoSerializers.scala:172)
    at scala.scalajs.ir.InfoSerializers$Deserializer.deserializeFull(InfoSerializers.scala:120)
    at scala.scalajs.ir.InfoSerializers$.deserializeVersionFullInfo(InfoSerializers.scala:43)
    at scala.scalajs.ir.InfoSerializers$.deserializeFullInfo(InfoSerializers.scala:35)
    at scala.scalajs.tools.io.VirtualSerializedScalaJSIRFile$class.info(VirtualFiles.scala:128)
    at scala.scalajs.tools.io.FileVirtualScalaJSIRFile.info(FileVirtualFiles.scala:143)
    at scala.scalajs.tools.optimizer.ScalaJSOptimizer$PersistentIRFile.updateFile(ScalaJSOptimizer.scala:443)
    at scala.scalajs.tools.optimizer.ScalaJSOptimizer$PersistentState.getPersistentIRFile(ScalaJSOptimizer.scala:403)
    at scala.scalajs.tools.optimizer.ScalaJSOptimizer$$anonfun$scala$scalajs$tools$optimizer$ScalaJSOptimizer$$readAllData$1.apply(ScalaJSOptimizer.scala:136)
    at scala.scalajs.tools.optimizer.ScalaJSOptimizer$$anonfun$scala$scalajs$tools$optimizer$ScalaJSOptimizer$$readAllData$1.apply(ScalaJSOptimizer.scala:136)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
    at scala.collection.AbstractTraversable.map(Traversable.scala:105)
    at scala.scalajs.tools.optimizer.ScalaJSOptimizer.scala$scalajs$tools$optimizer$ScalaJSOptimizer$$readAllData(ScalaJSOptimizer.scala:136)
    at scala.scalajs.tools.optimizer.ScalaJSOptimizer$$anonfun$2.apply(ScalaJSOptimizer.scala:69)
    at scala.scalajs.tools.optimizer.ScalaJSOptimizer$$anonfun$2.apply(ScalaJSOptimizer.scala:69)
    at scala.scalajs.tools.optimizer.IncOptimizer$.logTime(IncOptimizer.scala:731)
    at scala.scalajs.tools.optimizer.ScalaJSOptimizer.optimizeIR(ScalaJSOptimizer.scala:68)
    at scala.scalajs.tools.optimizer.ScalaJSOptimizer$$anonfun$optimizeCP$1.apply$mcV$sp(ScalaJSOptimizer.scala:56)
    at scala.scalajs.tools.io.CacheUtils$.cached(CacheUtils.scala:39)
    at scala.scalajs.tools.optimizer.ScalaJSOptimizer.optimizeCP(ScalaJSOptimizer.scala:54)
    at scala.scalajs.sbtplugin.ScalaJSPluginInternal$$anonfun$21.apply(ScalaJSPluginInternal.scala:194)
    at scala.scalajs.sbtplugin.ScalaJSPluginInternal$$anonfun$21.apply(ScalaJSPluginInternal.scala:181)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
[error] (compile:fastOptJS) java.io.IOException: This version (0.5.5) of Scala.js IR is not supported. Supported versions are: 0.5.0, 0.5.2, 0.5.3
lihaoyi commented 9 years ago

Odd, it seems to work for me. This is a brand new machine since my old was bricked, so I don't have any leftover caches or anything. Did you muck with the project/build.sbt file to change the version or add more plugins?

haoyi-mbp:~ haoyi$ git clone https://github.com/lihaoyi/workbench-example-app -b todomvc
Cloning into 'workbench-example-app'...
remote: Counting objects: 919, done.
remote: Total 919 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (919/919), 681.07 KiB | 921.00 KiB/s, done.
Resolving deltas: 100% (324/324), done.
Checking connectivity... done.
haoyi-mbp:~ haoyi$ cd workbench-example-app/
haoyi-mbp:workbench-example-app haoyi$ sbt ~fastOptJS
Getting org.scala-sbt sbt 0.13.0 ...
:: retrieving :: org.scala-sbt#boot-app
    confs: [default]
    43 artifacts copied, 0 already retrieved (12440kB/1520ms)
Getting Scala 2.10.2 (for sbt)...
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10.2/scala-compiler-2.10.2.jar ...
    [SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.2!scala-compiler.jar (3666ms)
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.2/scala-library-2.10.2.jar ...
    [SUCCESSFUL ] org.scala-lang#scala-library;2.10.2!scala-library.jar (2030ms)
downloading https://repo1.maven.org/maven2/org/scala-lang/jline/2.10.2/jline-2.10.2.jar ...
    [SUCCESSFUL ] org.scala-lang#jline;2.10.2!jline.jar (305ms)
:: retrieving :: org.scala-sbt#boot-scala
    confs: [default]
    5 artifacts copied, 0 already retrieved (24390kB/110ms)
[info] Loading project definition from /Users/haoyi/workbench-example-app/project
[info] Updating {file:/Users/haoyi/workbench-example-app/project/}workbench-example-app-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading http://repo1.maven.org/maven2/com/lihaoyi/workbench_2.10_0.13/0.1.5/workbench-0.1.5.jar ...
[info]  [SUCCESSFUL ] com.lihaoyi#workbench;0.1.5!workbench.jar (474ms)
[info] downloading http://repo1.maven.org/maven2/io/spray/spray-can/1.3.1/spray-can-1.3.1.jar ...
[info]  [SUCCESSFUL ] io.spray#spray-can;1.3.1!spray-can.jar(bundle) (1374ms)
[info] downloading http://repo1.maven.org/maven2/io/spray/spray-routing/1.3.1/spray-routing-1.3.1.jar ...
[info]  [SUCCESSFUL ] io.spray#spray-routing;1.3.1!spray-routing.jar(bundle) (1279ms)
[info] downloading http://repo1.maven.org/maven2/com/typesafe/akka/akka-actor_2.10/2.3.0/akka-actor_2.10-2.3.0.jar ...
[info]  [SUCCESSFUL ] com.typesafe.akka#akka-actor_2.10;2.3.0!akka-actor_2.10.jar (816ms)
[info] downloading http://repo1.maven.org/maven2/com/lihaoyi/upickle_2.10/0.2.1/upickle_2.10-0.2.1.jar ...
[info]  [SUCCESSFUL ] com.lihaoyi#upickle_2.10;0.2.1!upickle_2.10.jar (342ms)
[info] downloading http://repo1.maven.org/maven2/io/spray/spray-io/1.3.1/spray-io-1.3.1.jar ...
[info]  [SUCCESSFUL ] io.spray#spray-io;1.3.1!spray-io.jar(bundle) (303ms)
[info] downloading http://repo1.maven.org/maven2/io/spray/spray-http/1.3.1/spray-http-1.3.1.jar ...
[info]  [SUCCESSFUL ] io.spray#spray-http;1.3.1!spray-http.jar(bundle) (571ms)
[info] downloading http://repo1.maven.org/maven2/io/spray/spray-util/1.3.1/spray-util-1.3.1.jar ...
[info]  [SUCCESSFUL ] io.spray#spray-util;1.3.1!spray-util.jar(bundle) (273ms)
[info] downloading http://repo1.maven.org/maven2/org/parboiled/parboiled-scala_2.10/1.1.6/parboiled-scala_2.10-1.1.6.jar ...
[info]  [SUCCESSFUL ] org.parboiled#parboiled-scala_2.10;1.1.6!parboiled-scala_2.10.jar(bundle) (290ms)
[info] downloading http://repo1.maven.org/maven2/io/spray/spray-httpx/1.3.1/spray-httpx-1.3.1.jar ...
[info]  [SUCCESSFUL ] io.spray#spray-httpx;1.3.1!spray-httpx.jar(bundle) (351ms)
[info] downloading http://repo1.maven.org/maven2/com/chuusai/shapeless_2.10/1.2.4/shapeless_2.10-1.2.4.jar ...
[info]  [SUCCESSFUL ] com.chuusai#shapeless_2.10;1.2.4!shapeless_2.10.jar (494ms)
[info] Done updating.
[info] Set current project to Example (in build file:/Users/haoyi/workbench-example-app/)
[INFO] [11/26/2014 15:41:27.410] [SystemLol-akka.actor.default-dispatcher-3] [akka://SystemLol/user/IO-HTTP/listener-0] Bound to localhost/127.0.0.1:12345
[info] Updating {file:/Users/haoyi/workbench-example-app/}workbench-example-app...
[info] Resolving jline#jline;2.12 ...
[info] downloading http://dl.bintray.com/content/scala-js/scala-js-releases/org.scala-lang.modules.scalajs/scalajs-library_2.11/0.5.3/srcs/scalajs-library_2.11-sources.jar ...
[info]  [SUCCESSFUL ] org.scala-lang.modules.scalajs#scalajs-library_2.11;0.5.3!scalajs-library_2.11.jar(src) (832ms)
[info] downloading http://dl.bintray.com/content/scala-js/scala-js-releases/org.scala-lang.modules.scalajs/scalajs-library_2.11/0.5.3/docs/scalajs-library_2.11-javadoc.jar ...
[info]  [SUCCESSFUL ] org.scala-lang.modules.scalajs#scalajs-library_2.11;0.5.3!scalajs-library_2.11.jar(doc) (1471ms)
[info] downloading http://repo1.maven.org/maven2/com/scalatags/scalatags_sjs0.5_2.11/0.4.0/scalatags_sjs0.5_2.11-0.4.0.jar ...
[info]  [SUCCESSFUL ] com.scalatags#scalatags_sjs0.5_2.11;0.4.0!scalatags_sjs0.5_2.11.jar (386ms)
[info] Done updating.
[info] Compiling 2 Scala sources to /Users/haoyi/workbench-example-app/target/scala-2.11/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.11.2. Compiling...
[info]   Compilation completed in 8.866 s
[warn] there were two feature warnings; re-run with -feature for details
[warn] one warning found
[info] Fast optimizing /Users/haoyi/workbench-example-app/target/scala-2.11/example-fastopt.js
[info] workbench: Checking example-fastopt.js
[info] workbench: Refreshing http://localhost:12345/target/scala-2.11/example-fastopt.js
[success] Total time: 19 s, completed Nov 26, 2014 3:41:46 PM
1. Waiting for source changes... (press enter to interrupt)
tomjridge commented 9 years ago

During the initial build, there was an "out of memory" problem. My machine has only 4 GB. I'll give it another go and report back here. Thanks for responding.

tomjridge commented 9 years ago

I've increased memory to 6GB. I still get a "java.lang.OutOfMemoryError: PermGen space" when compiling, but compiling again succeeds and the application now runs. Thanks for your help.

lihaoyi commented 9 years ago

Did you give your jvm more memory? Just because your machine has 4gb doesn't mean it'll use it. I think it defaults to 256mb or 512mb or some relatively small quantity like that