Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with empty LESS file #76

Closed
eximius313 opened this issue Sep 22, 2015 · 4 comments
Closed

Exception with empty LESS file #76

eximius313 opened this issue Sep 22, 2015 · 4 comments

Comments

@eximius313
Copy link

If I have an empty less file, Play Framewok will throw this exception:

Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets compilation, which in some cases may
be orders of magnitude slower than using node.js.
[info] LESS compiling on 1 source(s)
[error] TypeError: [object Object] is not a function, it is object. (/path/project/target/node-modules/webjars/less/lib/less/index.js#4)
  at /path/project/target/node-modules/webjars/less/lib/less/index.js:4
[error]     at /path/project/target/node-modules/webjars/less/lib/less-node/index.js:1
[error]     at module.js:456
[error]     at module.js:474
[error]     at module.js:356
[error]     at module.js:312
[error]     at module.js:364
[error]     at require (module.js:380)
[error]     at /path/project/target/node-modules/webjars/less/index.js:1
[error]     at module.js:456
[error]     at module.js:474
[error]     at module.js:356
[error]     at module.js:312
[error]     at module.js:364
[error]     at require (module.js:380)
[error]     at /path/project/target/less/sbt-less-1.1.0.jar:14
[error]     at /path/project/target/less/sbt-less-1.1.0.jar:3
[error]     at module.js:456
[error]     at module.js:474
[error]     at module.js:356
[error]     at module.js:312
[error]     at module.js:497
[error]     at startup (trireme.js:142)
[error]     at trireme.js:923
[info]
[trace] Stack trace suppressed: run last web-assets:less for the full output.
[error] (web-assets:less) com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: TypeError: [object Object] is not a function, it is object. (/home/users/project/project
/project/target/node-modules/webjars/less/lib/less/index.js#4)    at /path/project/target/node-modules/webjars/less/lib/less/index.js:4
[error]     at /path/project/target/node-modules/webjars/less/lib/less-node/index.js:1
[error]     at module.js:456
[error]     at module.js:474
[error]     at module.js:356
[error]     at module.js:312
[error]     at module.js:364
[error]     at require (module.js:380)
[error]     at /path/project/target/node-modules/webjars/less/index.js:1
[error]     at module.js:456
[error]     at module.js:474
[error]     at module.js:356
[error]     at module.js:312
[error]     at module.js:364
[error]     at require (module.js:380)
[error]     at /path/project/target/less/sbt-less-1.1.0.jar:14
[error]     at /path/project/target/less/sbt-less-1.1.0.jar:3
[error]     at module.js:456
[error]     at module.js:474
[error]     at module.js:356
[error]     at module.js:312
[error]     at module.js:497
[error]     at startup (trireme.js:142)
[error]     at trireme.js:923
[error] application -
! @6n7dim8ji - Internal server error, for (GET) [/] ->

play.sbt.PlayExceptions$UnexpectedException: Unexpected exception[JsTaskFailure: TypeError: [object Object] is not a function, it is object. (/home/users/projec
t/project/project/target/node-modules/webjars/less/lib/less/index.js#4)    at /path/project/target/node-modules/webjars/less/lib/less/inde
x.js:4
    at /path/project/target/node-modules/webjars/less/lib/less-node/index.js:1
    at module.js:456
    at module.js:474
    at module.js:356
    at module.js:312
    at module.js:364
    at require (module.js:380)
    at /path/project/target/node-modules/webjars/less/index.js:1
    at module.js:456
    at module.js:474
    at module.js:356
    at module.js:312
    at module.js:364
    at require (module.js:380)
    at /path/project/target/less/sbt-less-1.1.0.jar:14
    at /path/project/target/less/sbt-less-1.1.0.jar:3
    at module.js:456
    at module.js:474
    at module.js:356
    at module.js:312
    at module.js:497
    at startup (trireme.js:142)
    at trireme.js:923
]
        at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:51) ~[na:na]
        at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44) ~[na:na]
        at scala.Option.map(Option.scala:145) ~[scala-library-2.11.6.jar:na]
        at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:44) ~[na:na]
        at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:40) ~[na:na]
        at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17) ~[na:na]
        at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17) ~[na:na]
        at scala.util.Either$LeftProjection.map(Either.scala:377) ~[scala-library-2.11.6.jar:na]
        at play.sbt.run.PlayReload$.compile(PlayReload.scala:17) ~[na:na]
        at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3$$anonfun$2.apply(PlayRun.scala:60) ~[na:na]
Caused by: com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: TypeError: [object Object] is not a function, it is object. (/path/project/target
/node-modules/webjars/less/lib/less/index.js#4)    at /path/project/target/node-modules/webjars/less/lib/less/index.js:4
    at /path/project/target/node-modules/webjars/less/lib/less-node/index.js:1
    at module.js:456
    at module.js:474
    at module.js:356
    at module.js:312
    at module.js:364
    at require (module.js:380)
    at /path/project/target/node-modules/webjars/less/index.js:1
    at module.js:456
    at module.js:474
    at module.js:356
    at module.js:312
    at module.js:364
    at require (module.js:380)
    at /path/project/target/less/sbt-less-1.1.0.jar:14
   at /path/project/target/less/sbt-less-1.1.0.jar:3
   at module.js:456
   at module.js:474
   at module.js:356
   at module.js:312
   at module.js:497
   at startup (trireme.js:142)
   at trireme.js:923

       at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:195) ~[na:na]
       at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:167) ~[na:na]
       at scala.util.Success$$anonfun$map$1.apply(Try.scala:206) ~[scala-library-2.11.6.jar:na]
       at scala.util.Try$.apply(Try.scala:161) ~[scala-library-2.11.6.jar:na]
       at scala.util.Success.map(Try.scala:206) ~[scala-library-2.11.6.jar:na]
       at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235) ~[scala-library-2.11.6.jar:na]
       at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235) ~[scala-library-2.11.6.jar:na]
       at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) ~[scala-library-2.11.6.jar:na]
       at scala.concurrent.impl.ExecutionContextImpl$$anon$3.exec(ExecutionContextImpl.scala:107) ~[scala-library-2.11.6.jar:na]
       at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) ~[scala-library-2.11.6.jar:na]

If I remove the file - everything works

@huntc
Copy link
Contributor

huntc commented Sep 22, 2015

Have you tried the latest version? I recall this issue from a long time back b

@eximius313
Copy link
Author

I'm using:

addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.0")

@jroper
Copy link
Member

jroper commented Sep 23, 2015

According to the discussion in #53, this is actually a bug in less itself: less/less.js#2430

@eximius313
Copy link
Author

It seems that this is not only for empty file: #80 so I'm closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants