Clojure Lein Figwheel 错误 - 带有 Re-Frame 的 Luminus 项目

Clojure Lein Figwheel Error - Luminus Project with Re-Frame

我正在尝试使用 Luminus 创建网络应用程序。 我用 lein new luminus my-app +reagent +sqlite 创建了一个项目,没有更改任何文件,只是试图 运行 figwheel 用 lein figwheel 编译 javascript 但得到以下错误:

Figwheel: Cutting some fruit, just a sec ...
Retrieving clj-time/clj-time/0.14.3/clj-time-0.14.3.pom from clojars
Retrieving joda-time/joda-time/2.9.9/joda-time-2.9.9.pom from central
Retrieving conman/conman/0.7.8/conman-0.7.8.pom from clojars
Retrieving org/clojure/java.jdbc/0.7.5/java.jdbc-0.7.5.pom from central
Retrieving org/clojure/tools.cli/0.3.6/tools.cli-0.3.6.pom from central
Retrieving joda-time/joda-time/2.9.9/joda-time-2.9.9.jar from central
Retrieving org/clojure/java.jdbc/0.7.5/java.jdbc-0.7.5.jar from central
Retrieving org/clojure/tools.cli/0.3.6/tools.cli-0.3.6.jar from central
Retrieving clj-time/clj-time/0.14.3/clj-time-0.14.3.jar from clojars
Retrieving conman/conman/0.7.8/conman-0.7.8.jar from clojars
Exception in thread "main" java.lang.ExceptionInInitializerError
    at clojure.main.<clinit>(main.java:20)
Caused by: java.lang.ExceptionInInitializerError, compiling: (figwheel_sidecar/utils.clj:1:1)
    at clojure.lang.Compiler.load(Compiler.java:7526)
    at clojure.lang.RT.loadResourceScript(RT.java:379)

(... Many more lines)

我的 project.clj :dependencies 看起来像这样:

 :dependencies [[clj-time "0.14.3"]
             [cljs-ajax "0.7.3"]
             [compojure "1.6.0"]
             [conman "0.7.8"]
             [cprop "0.1.11"]
             [funcool/struct "1.2.0"]
             [luminus-immutant "0.2.4"]
             [luminus-migrations "0.5.0"]
             [luminus-nrepl "0.1.4"]
             [luminus/ring-ttl-session "0.3.2"]
             [markdown-clj "1.0.2"]
             [metosin/muuntaja "0.5.0"]
             [metosin/ring-http-response "0.9.0"]
             [mount "0.1.12"]
             [org.clojure/clojure "1.9.0"]
             [org.clojure/clojurescript "1.10.238" :scope "provided"]
             [org.clojure/tools.cli "0.3.6"]
             [org.clojure/tools.logging "0.4.0"]
             [org.webjars.bower/tether "1.4.3"]
             [org.webjars/bootstrap "4.0.0-2"]
             [org.webjars/font-awesome "5.0.9"]
             [org.xerial/sqlite-jdbc "3.21.0.1"]
             [re-frame "0.10.5"]
             [reagent "0.7.0"]
             [ring-webjars "0.2.0"]
             [ring/ring-core "1.6.3"]
             [ring/ring-defaults "0.3.1"]
             [secretary "1.2.3"]
             [selmer "1.11.7"]]

如何解决这个错误? Luminus 可能已经过时了吗?如果是,我应该如何开始使用 Clojure 开发 Web 应用程序?

我刚刚尝试将 ClojureScript 项目配置为与 Figwheel 和 Doo 测试框架一起使用。代码位于此 repo 中:

git@github.com:cloojure/cljs-base-project.git

它还不包括任何服务器端的东西,但我会添加更多。

如果您是从 CLJS 的东西开始的(正如您问题中的齿轮部分所暗示的那样),您可能希望从这里开始,然后添加 Ring、Luminous 等位。

此外,请务必 check out lein-ancient 检查您的依赖项的过时版本。

我已更新模板以引用 user 中的正确命名空间。如果您仍然遇到问题,需要检查的几件事是 JDK 版本(推荐 8+),以及 ~/.lein/profiles.clj 文件中是否有任何可能导致冲突的插件。