Google Groups

Re: [2.0] Closure compiler doesn't work with simple JS?


Simon Mar 18, 2012 8:35 PM
Posted in group: play-framework
Thanks Ben.

If this gets fixed it would be the cherry on the ice cream for me.

On Monday, March 19, 2012 2:11:41 PM UTC+11, Ben McCann wrote:
The Closure compiler integration is broken I believe.  I've seen several threads about it and no one seems to have gotten it work.  I submitted a pull request a month ago and am waiting for it to be committed:

-Ben


On Sunday, March 18, 2012 6:51:26 PM UTC-7, Simon wrote:
I created a new play project and then created a file called "test.js" in the app/assets folder and it gave the same error.

It seems like Play wont compile simple JS files. Any ideas? 

I get the following error:

[error] application -

! Internal server error, for request [GET /] ->

sbt.PlayExceptions$AssetCompilationException: Compilation error [Internal Closure Compiler error (see logs)]
        at play.core.jscompile.JavascriptCompiler$.compile(JavascriptCompiler.scala:53) ~[na:na]
        at sbt.PlayCommands$$anonfun$36.apply(PlayCommands.scala:417) ~[na:na]
        at sbt.PlayCommands$$anonfun$36.apply(PlayCommands.scala:417) ~[na:na]
        at sbt.PlayCommands$$anonfun$AssetsCompiler$1$$anonfun$30.apply(PlayCommands.scala:378) ~[na:na]
        at sbt.PlayCommands$$anonfun$AssetsCompiler$1$$anonfun$30.apply(PlayCommands.scala:376) ~[na:na]
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:200) ~[scala-library.jar:0.11.2]
java.lang.RuntimeException: java.lang.RuntimeException: com.google.javascript.jscomp.deps.SortedDependencies$MissingProvideException: module$test
        at com.google.javascript.jscomp.Compiler.runCallable(Compiler.java:629)
        at com.google.javascript.jscomp.Compiler.runInCompilerThread(Compiler.java:574)
        at com.google.javascript.jscomp.Compiler.compile(Compiler.java:556)
        at com.google.javascript.jscomp.Compiler.compile(Compiler.java:515)
        at com.google.javascript.jscomp.Compiler.compile(Compiler.java:497)
        at com.google.javascript.jscomp.Compiler.compile(Compiler.java:483)
        at play.core.jscompile.JavascriptCompiler$$anonfun$compile$1.apply$mcZ$sp(JavascriptCompiler.scala:44)
        at play.core.jscompile.JavascriptCompiler$$anonfun$compile$1.apply(JavascriptCompiler.scala:44)
        at play.core.jscompile.JavascriptCompiler$$anonfun$compile$1.apply(JavascriptCompiler.scala:44)
        at scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala:110)
        at scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala:110)
        at scala.util.control.Exception$Catch.apply(Exception.scala:88)
        at scala.util.control.Exception$Catch.either(Exception.scala:110)
        at play.core.jscompile.JavascriptCompiler$.compile(JavascriptCompiler.scala:44)
        at sbt.PlayCommands$$anonfun$36.apply(PlayCommands.scala:417)
        at sbt.PlayCommands$$anonfun$36.apply(PlayCommands.scala:417)
        at sbt.PlayCommands$$anonfun$AssetsCompiler$1$$anonfun$30.apply(PlayCommands.scala:378)
        at sbt.PlayCommands$$anonfun$AssetsCompiler$1$$anonfun$30.apply(PlayCommands.scala:376)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:200)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:200)
        at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:44)
        at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:200)
        at scala.collection.mutable.ArrayBuffer.flatMap(ArrayBuffer.scala:44)
        at sbt.PlayCommands$$anonfun$AssetsCompiler$1.apply(PlayCommands.scala:376)
        at sbt.PlayCommands$$anonfun$AssetsCompiler$1.apply(PlayCommands.scala:363)
        at sbt.Scoped$$anonfun$hf5$1.apply(Structure.scala:476)
        at sbt.Scoped$$anonfun$hf5$1.apply(Structure.scala:476)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:41)
        at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$11.apply(Structure.scala:295)
        at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$11.apply(Structure.scala:295)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$5.work(System.scala:67)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:221)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:221)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
        at sbt.Execute.work(Execute.scala:227)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221)
        at sbt.CompletionService$$anon$1$$anon$2.call(CompletionService.scala:26)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: com.google.javascript.jscomp.deps.SortedDependencies$MissingProvideException: module$test
        at com.google.common.base.Throwables.propagate(Throwables.java:156)
        at com.google.javascript.jscomp.Compiler.processAMDAndCommonJSModules(Compiler.java:1396)
        at com.google.javascript.jscomp.Compiler.parseInputs(Compiler.java:1232)
        at com.google.javascript.jscomp.Compiler.parse(Compiler.java:678)
        at com.google.javascript.jscomp.Compiler.compileInternal(Compiler.java:636)
        at com.google.javascript.jscomp.Compiler.access$000(Compiler.java:70)
        at com.google.javascript.jscomp.Compiler$1.call(Compiler.java:559)
        at com.google.javascript.jscomp.Compiler$1.call(Compiler.java:556)
        at com.google.javascript.jscomp.Compiler$2.run(Compiler.java:601)
        ... 1 more
Caused by: com.google.javascript.jscomp.deps.SortedDependencies$MissingProvideException: module$test
        at com.google.javascript.jscomp.deps.SortedDependencies.getInputProviding(SortedDependencies.java:120)
        at com.google.javascript.jscomp.JSModuleGraph.manageDependencies(JSModuleGraph.java:325)
        at com.google.javascript.jscomp.Compiler.processAMDAndCommonJSModules(Compiler.java:1389)
        ... 8 more
[error] {file:/D:/Dropbox/Dev/HomeHerld/ScalaWorkspace/test_app/}test_app/*:play-copy-assets: PlayException: Compilation error [Internal Closure Compi
ler error (see logs)]
[error] application -

! Internal server error, for request [GET /] ->

sbt.PlayExceptions$AssetCompilationException: Compilation error [Internal Closure Compiler error (see logs)]
        at play.core.jscompile.JavascriptCompiler$.compile(JavascriptCompiler.scala:53) ~[na:na]
        at sbt.PlayCommands$$anonfun$36.apply(PlayCommands.scala:417) ~[na:na]
        at sbt.PlayCommands$$anonfun$36.apply(PlayCommands.scala:417) ~[na:na]
        at sbt.PlayCommands$$anonfun$AssetsCompiler$1$$anonfun$30.apply(PlayCommands.scala:378) ~[na:na]
        at sbt.PlayCommands$$anonfun$AssetsCompiler$1$$anonfun$30.apply(PlayCommands.scala:376) ~[na:na]
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:200) ~[scala-library.jar:0.11.2]


On Monday, March 19, 2012 9:34:27 AM UTC+11, Simon wrote:
Hi,

I have been following this page in the wiki:


I create lib.js and test.js in the app/assets/javascripts folder and no matter what I do I get "Internal Closure Compiler error (see logs)" and it points to line 0

Has anyone followed the instructions in the wiki page above? I cant get it to work no matter what I do.

Thanks,
Simon