新しいことをやってみるシリーズ:Play Framework2.3.1でsbt-lessでエラーが出た時にすること

Play Frameworkのドキュメントに従ってファイルを置いた上でコンパイルした際に

[info] LESS compiling on 1 source(s)
spray.json.DeserializationException: Expected Int as JsNumber, but got null
        at spray.json.package$.deserializationError(package.scala:23)
        at spray.json.BasicFormats$IntJsonFormat$.read(BasicFormats.scala:29)
        at spray.json.BasicFormats$IntJsonFormat$.read(BasicFormats.scala:25)
        at spray.json.JsValue.convertTo(JsValue.scala:32)
        at com.typesafe.sbt.jse.SbtJsTask$JsTaskProtocol$LineBasedProblemFormat$$anonfun$read$7.apply(SbtJsTask.scala:117)
        at com.typesafe.sbt.jse.SbtJsTask$JsTaskProtocol$LineBasedProblemFormat$$anonfun$read$7.apply(SbtJsTask.scala:117)
        at scala.Option.fold(Option.scala:157)
        at com.typesafe.sbt.jse.SbtJsTask$JsTaskProtocol$LineBasedProblemFormat$.read(SbtJsTask.scala:117)
        at com.typesafe.sbt.jse.SbtJsTask$JsTaskProtocol$LineBasedProblemFormat$.read(SbtJsTask.scala:105)
        at spray.json.JsValue.convertTo(JsValue.scala:32)
        at spray.json.CollectionFormats$$anon$4$$anonfun$read$4.apply(CollectionFormats.scala:89)
        at spray.json.CollectionFormats$$anon$4$$anonfun$read$4.apply(CollectionFormats.scala:89)
        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 spray.json.CollectionFormats$$anon$4.read(CollectionFormats.scala:89)
        at spray.json.CollectionFormats$$anon$4.read(CollectionFormats.scala:86)
        at spray.json.ProductFormats$class.fromField(ProductFormats.scala:47)
        at com.typesafe.sbt.jse.SbtJsTask$JsTaskProtocol$.fromField(SbtJsTask.scala:92)
        at spray.json.ProductFormatsInstances$$anon$2.read(ProductFormatsInstances.scala:56)
        at spray.json.ProductFormatsInstances$$anon$2.read(ProductFormatsInstances.scala:46)
        at spray.json.JsValue.convertTo(JsValue.scala:32)
        at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeSourceFilesJs$1$$anonfun$7.apply(SbtJsTask.scala:225)
        at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeSourceFilesJs$1$$anonfun$7.apply(SbtJsTask.scala:224)
        at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:111)
        at scala.collection.immutable.List.foldLeft(List.scala:84)
        at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeSourceFilesJs$1.apply(SbtJsTask.scala:223)
        at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeSourceFilesJs$1.apply(SbtJsTask.scala:221)
        at scala.util.Success$$anonfun$map$1.apply(Try.scala:206)
        at scala.util.Try$.apply(Try.scala:161)
        at scala.util.Success.map(Try.scala:206)
        at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
        at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
        at scala.concurrent.impl.ExecutionContextImpl$$anon$3.exec(ExecutionContextImpl.scala:107)
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[error] (web-assets:less) spray.json.DeserializationException: Expected Int as JsNumber, but got null

というエラーが出ることがあります。これは空のlessファイルを置くと発生するので、とりあえず適当に中身を入れておきましょう。

空ファイルがダメって・・・と思いますが、次のバージョンでfixされるようです。

https://github.com/sbt/sbt-less/issues/21