leincljs build error : java.lang.IllegalStateException

leincljs build error : java.lang.IllegalStateException

我的 lein 项目目录中只有 运行 lein cljsbuild once,但出现错误 java.lang.IllegalStateException : Can't dynamically bind non-dynamic var: clojure.tools.reader/resolve-symbol

堆栈跟踪:

https://gist.githubusercontent.com/fyquah95/0a02b06c0a9aa2225f9c/raw/0cc05629a18c3711e27b1fc9dd59db0532d964b8/gistfile1.txt

我的 project.clj 文件:

(defproject barclays-cycle-hire-stats "0.1.0-SNAPSHOT"                                                                                                                               
  :description "FIXME: write description"                                                                                                                                            
  :url "http://example.com/FIXME"                                                                                                                                                    
  :license {:name "Eclipse Public License"                                                                                                                                           
            :url "http://www.eclipse.org/legal/epl-v10.html"}                                                                                                                        
  :main barclays-cycle-hire-stats.core                                                                                                                                               
  :plugins [[lein-cljsbuild "1.0.6"]                                                                                                                                                 
            [lein-ring "0.8.7"]]                                                                                                                                                     
  :source-paths ["src/clj"]                                                                                                                                                          
  :cljsbuild {                                                                                                                                                                       
    :builds [{:source-paths ["src/cljs"]                                                                                                                                             
              :compiler {:output-to "resources/public/js/main.js"                                                                                                                    
                         :optimizations :whitespace                                                                                                                                  
                         :pretty-print true}}]}                                                                                                                                      
  :dependencies [[http-kit "2.1.18"]                                                                                                                                                 
                 [reagent "0.5.1-rc"]                                                                                                                                                
                 [cljs-ajax "0.3.14"]                                                                                                                                                
                 [compojure "1.1.6"]                                                                                                                                                 
                 [hiccup "1.0.4"]                                                                                                                                                    
                 [org.clojure/math.numeric-tower "0.0.4"]                                                                                                                            
                 ; [org.clojure/clojure.core.async "0.1.346.0-17112a-alpha"]                                                                                                         
                 [spyscope "0.1.5"]                                                                                                                                                  
                 [org.clojure/math.combinatorics "0.1.1"]                                                                                                                            
                 [org.clojure/data.json "0.2.6"]                                                                                                                                     
                 [org.clojure/clojure "1.7.0"]                                                                                                                                       
                 [org.clojure/clojurescript "1.7.48" :exclusion [org.clojure/data.json]]                                                                                             
                 [org.clojure/data.csv "0.1.3"]]                                                                                                                                     
  :eval-in-leiningen true                                                                                                                                                            
  :ring {:handler barclays-cycle-hire-stats.routes/app})

尝试不使用 :eval-in-leiningen true

:eval-in-leiningen 用于插件,在项目中使用时会出现奇怪的错误。

您可以在 leiningen

Project isolation section of leiningen.core doc, and Plugins 文档中找到有关 :eval-in-leiningen:eval-in-project 的信息

将 :exclusions [org.apache.ant/ant] 添加到 clojurescript 依赖项为我修复了相同的错误消息。所以它看起来像这样:

[org.clojure/clojurescript "1.7.48" :exclusions [org.apache.ant/ant]]