【发布时间】:2019-02-12 23:23:57
【问题描述】:
我没有看到任何编译日志文件,终端中的错误不足以让我进一步排除故障。 如何获得更详细的错误日志记录或如何解决此问题?
下面堆栈跟踪的前几行
Compiling ClojureScript...
Compiling ["resources/public/js/app.js"] from ["src/cljs"]...
Compiling ["resources/public/js/app.js"] failed.
clojure.lang.ExceptionInfo: failed compiling file:resources\public\js\out\cljs\core.cljs {:file #object[java.io.File 0x7c5d1d25 "resources\\public\\js\\out\\cljs\\core.cljs"], :clojure.error/phase :compilation}
at cljs.compiler$compile_file$fn__3901.invoke(compiler.cljc:1706)
at cljs.compiler$compile_file.invokeStatic(compiler.cljc:1666)
我有一个简单的 cljs 文件,内容如下
(ns moose.core)
(defn run []
(.write js/document "This is not the end!"))
我的 project.clj 对 cljsbuild 有以下配置
:cljsbuild
{:builds [{:id "dev"
:source-paths ["src/cljs"]
:figwheel {:on-jsload "moose.core/run"
:open-urls ["http://localhost:3449/index.html"]}
:jar true
:compiler {:main moose.core
:warnings true
:output-dir "resources/public/js/out"
:asset-path "js/out"
:output-to "resources/public/js/app.js"}}]}
:clean-targets ^{:protect false} [:target-path :compile-path "resources/public/js" "dev-target"]
更新 1 按照下面 Alan 的建议,我创建了一个新模板并缩小了原因,以添加一个相当老的库来与 CouchDB 交互
问题仍然是如何获取 cljsbuild 的详细/完整日志。
更新 2 原来库在依赖项列表中的位置会产生影响。 如果它出现在[com.cognitect/transit-clj "0.8.313"] 之前编译失败,否则它可以工作。
【问题讨论】:
-
如果 cljsbuild 为 ClojureScript 1.10.439 及更早版本的失败生成更多信息,将会很有趣。 (ClojureScript 1.10.516 引入了对异常消息的更改。)如果是这样,也许可以编写针对 cljsbuild 的票证以使其针对 1.10.516 进行更新。
-
@MikeFikes 我尝试了 238,439,516 和 520 得到了相同的错误消息,但调用站点不同,而且只是这条附加信息“:clojure.error/phase :compilation”