2

在 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-less 1.0.6。烦人,但至少它完成了工作。

4

2 回答 2

1

尝试通过设置运行一个干净的构建:

$ heroku config:set SBT_CLEAN="true"

然后重新部署您的应用程序。

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

于 2016-03-11T19:08:28.170 回答
0

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

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

(我从sbt-less 项目的issue #68(LESS 编译失败,异常)中得到了这个解决方案。)

于 2016-10-16T20:13:42.560 回答