为什么这个 clojurescript 构建配置文件可以在本地工作,但不能在 Heroku 上工作?
Why would this clojurescript build profile work locally but not on Heroku?
这里是 prod
在本地和 uberjar 中用于 Heroku 部署的配置:
{: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.
有什么建议吗?
我认为这不是 lein 2.5.1 中的问题。无论如何,请尝试 :externs ^:replace ["jquery/jquery-externs.js" "public/vendor/js/bootstrap.min.js"]
来缓解。
我也遇到过类似的错误,添加一些:exclusions
.
问题解决了
就我而言,我使用的是带有 Addons 和 Reagent 的 React(这取决于 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]]
这里是 prod
在本地和 uberjar 中用于 Heroku 部署的配置:
{: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.
有什么建议吗?
我认为这不是 lein 2.5.1 中的问题。无论如何,请尝试 :externs ^:replace ["jquery/jquery-externs.js" "public/vendor/js/bootstrap.min.js"]
来缓解。
我也遇到过类似的错误,添加一些:exclusions
.
就我而言,我使用的是带有 Addons 和 Reagent 的 React(这取决于 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]]