为什么这个clojurescript构建配置文件在本地工作但不在Heroku上工作?

时间:2015-01-14 12:40:16

标签: heroku clojurescript

以下是本地和在uberjar中用于Heroku部署的prod配置:

{:source-paths ["src/cljs"]
                :compiler {:output-to "resources/public/js/main.js"
                           :optimizations :advanced
                           :cache-analysis true
                           :static-fns true
                           :elide-asserts true
                           :pretty-print false
                           :externs ["jquery/jquery-externs.js" "public/vendor/js/bootstrap.min.js"]
                           :preamble ["jquery/jquery-2.1.1.min.js"
                                      "public/vendor/js/bootstrap.min.js"
                                      "reagent/react.js"]}}

但是为Heroku部署启用了externs指令,我收到了这个错误:

Jan 14, 2015 12:24:24 PM com.google.javascript.jscomp.LoggerErrorManager println
       SEVERE: ERROR - Duplicate extern input: /tmp/build_a17563dbd2ef7be695204764be886d91/resources/jquery/jquery-externs.js

       Jan 14, 2015 12:24:24 PM com.google.javascript.jscomp.LoggerErrorManager println
       SEVERE: ERROR - Duplicate extern input: /tmp/build_a17563dbd2ef7be695204764be886d91/resources/public/vendor/js/bootstrap.min.js

       Jan 14, 2015 12:24:24 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
       WARNING: 2 error(s), 0 warning(s)
       ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input: /tmp/build_a17563dbd2ef7be695204764be886d91/resources/jquery/jquery-externs.js at (unknown source) line (unknown line) : (unknown column)
       ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input: /tmp/build_a17563dbd2ef7be695204764be886d91/resources/public/vendor/js/bootstrap.min.js at (unknown source) line (unknown line) : (unknown column)
       Successfully compiled "resources/public/js/main.js" in 38.526 seconds.

有什么建议吗?

2 个答案:

答案 0 :(得分:2)

我不认为这是lein 2.5.1中的问题。无论如何,请尝试:externs ^:replace ["jquery/jquery-externs.js" "public/vendor/js/bootstrap.min.js"]来缓解。

答案 1 :(得分:1)

我遇到了类似的错误,通过添加一些:exclusions来解决问题。

在我的情况下,我使用React with Addons and Reagent(依赖于React),因此发生了碰撞。

错误:

:dependencies [[cljsjs/react-with-addons "0.13.3-0"]
               [reagent "0.5.0"]

右:

:dependencies [[cljsjs/react-with-addons "0.13.3-0"]
               [reagent "0.5.0" :exclusions [cljsjs/react]]