Sbt-LESS: TypeError: [object Object] 不是一个函数,它是一个对象



在Play项目上将Sbt-less从1.0.6更新到1.1.0后,当我尝试git push heroku master时收到此错误输出:

remote:        [error] TypeError: [object Object] is not a function, it is object. (/tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js#4)    at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js:4
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less-node/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:14
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:3
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:497
remote:        [error]     at startup (trireme.js:142)
remote:        [error]     at trireme.js:923
remote:        [info] 
remote:        [error] TypeError: [object Object] is not a function, it is object. (/tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js#4)    at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js:4
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less-node/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:14
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:3
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:497
remote:        [error]     at startup (trireme.js:142)
remote:        [error]     at trireme.js:923
remote:        [info] 
remote:        [error] TypeError: [object Object] is not a function, it is object. (/tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js#4)    at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js:4
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less-node/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:14
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:3
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:497
remote:        [error]     at startup (trireme.js:142)
remote:        [error]     at trireme.js:923
remote:        [info] 
remote:        [error] TypeError: [object Object] is not a function, it is object. (/tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js#4)    at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js:4
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less-node/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:14
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:3
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:497
remote:        [error]     at startup (trireme.js:142)
remote:        [error]     at trireme.js:923
remote:        [info] 
remote:        [error] TypeError: [object Object] is not a function, it is object. (/tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js#4)    at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js:4
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less-node/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:14
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:3
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:497
remote:        [error]     at startup (trireme.js:142)
remote:        [error]     at trireme.js:923
remote:        [info] 
remote:        com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: TypeError: [object Object] is not a function, it is object. (/tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js#4)    at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js:4
remote:            at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less-node/index.js:1
remote:            at module.js:456
remote:            at module.js:474
remote:            at module.js:356
remote:            at module.js:312
remote:            at module.js:364
remote:            at require (module.js:380)
remote:            at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/index.js:1
remote:            at module.js:456
remote:            at module.js:474
remote:            at module.js:356
remote:            at module.js:312
remote:            at module.js:364
remote:            at require (module.js:380)
remote:            at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:14
remote:            at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:3
remote:            at module.js:456
remote:            at module.js:474
remote:            at module.js:356
remote:            at module.js:312
remote:            at module.js:497
remote:            at startup (trireme.js:142)
remote:            at trireme.js:923
remote:        
remote:         at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:195)
remote:         at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:167)
remote:         at scala.util.Success$$anonfun$map$1.apply(Try.scala:206)
remote:         at scala.util.Try$.apply(Try.scala:161)
remote:         at scala.util.Success.map(Try.scala:206)
remote:         at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
remote:         at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
remote:         at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
remote:         at scala.concurrent.impl.ExecutionContextImpl$$anon$3.exec(ExecutionContextImpl.scala:107)
remote:         at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
remote:         at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
remote:         at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
remote:         at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
remote:        [error] (web-assets:less) com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: TypeError: [object Object] is not a function, it is object. (/tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js#4)    at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less/index.js:4
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/lib/less-node/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/node-modules/webjars/less/index.js:1
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:364
remote:        [error]     at require (module.js:380)
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:14
remote:        [error]     at /tmp/scala_buildpack_build_dir/project/target/less/sbt-less-1.1.0.jar:3
remote:        [error]     at module.js:456
remote:        [error]     at module.js:474
remote:        [error]     at module.js:356
remote:        [error]     at module.js:312
remote:        [error]     at module.js:497
remote:        [error]     at startup (trireme.js:142)
remote:        [error]     at trireme.js:923
remote:        [error] Total time: 5 s, completed Mar 11, 2016 3:18:15 AM
remote: 
remote:  !     ERROR: Failed to run sbt!
remote:        We're sorry this build is failing. If you can't find the issue in application
remote:        code, please submit a ticket so we can help: https://help.heroku.com
remote:        You can also try reverting to the previous version of the buildpack by running:
remote:        $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-scala#previous-version
remote:        
remote:        Thanks,
remote:        Heroku
remote: 
remote: 
remote:  !     Push rejected, failed to compile Play 2.x - Scala app
remote: 
remote: Verifying deploy...
remote: 
remote: !       Push rejected to vetpros-stage.
remote: 
To https://git.heroku.com/vetpros-stage.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/vetpros-stage.git'

项目本身在我编码的机器上工作正常。我试过heroku run "sbt clean-files"似乎没有效果。我在某处读到删除/target文件夹也可能有所帮助,但是当我尝试从 Heroku 的 bash 终端中删除它们时,它不会进行更改。任何建议都会有所帮助,提前感谢您!

编辑:我想出了一个解决方法,相当明显(你们中的许多人可能已经知道),但是每次上传到Heroku时,您可以简单地恢复到无sbt的1.0.6。很烦人,但至少它完成了工作。

尝试通过设置以下命令运行干净的构建:

$ heroku config:set SBT_CLEAN="true"

然后重新部署应用。

heroku run 命令在与应用程序隔离的单独容器中运行,并且不会永久修改文件系统(即 slug 映像)。

我在本地遇到了同样的问题,诀窍不仅是(不仅?)删除target文件夹,而且还project/target(甚至可能是project/project,但这在我的情况下不是必需的)。

也许如果您尝试从 Heroku 的 bash 终端中删除它们,它也适合您。

(我从无 sbt 项目的问题 #68(LESS 编译失败并出现异常)中获得了此解决方案。

相关内容

  • 没有找到相关文章

最新更新