0

我正在尝试为我的项目使用 figwheel build。我使用最新版本的库,我的 leiningen 版本是 2.5.1。我的构建文件如下所示:

(defproject figwheel-issue "1.2.3"
  :plugins [[lein-cljsbuild "1.0.6"]
            [lein-figwheel "0.3.3"]]
  :dependencies [[org.clojure/clojurescript "0.0-3269"]
                 [org.clojure/clojure "1.7.0-beta3"]]
  :cljsbuild {
              :builds [{ :id "dev"
                        :source-paths ["src"]
                        :figwheel true
                        :compiler {
                                   :main myproject/core
                                   :hashbang false
                                   :asset-path "js/out"
                                   :output-to "resources/public/js/example.js"
                                   :output-dir "resources/public/js/out"
                                   :optimizations :none}}]})

正常构建工作正常。所以当我运行时:

lein cljsbuild once

我得到:

Successfully compiled "resources/public/js/example.js" in 0.873 seconds.

但是当我尝试运行时:

lein figwheel

Figwheel build 似乎找不到我的核心命名空间:

Compiling "resources/public/js/example.js" failed.
clojure.lang.ExceptionInfo: failed compiling file:target/figwheel_temp/dev/figwheel/connect.cljs
 at clojure.core$ex_info.invoke (core.clj:4591)
Caused by: clojure.lang.ExceptionInfo: No such namespace: core, could not locate core.cljs, core.cljc, or Closure namespace "core" at line 1 target/figwheel_temp/dev/figwheel/connect.cljs
 at clojure.core$ex_info.invoke (core.clj:4591)

有什么想法可能是错的吗?我创建了一个最小的 github 项目来演示这里的问题:

https://github.com/auramo/figwheel-build-issue

4

1 回答 1

1

问题是命名空间,它应该是:

:main myproject.core
于 2015-05-31T11:40:12.473 回答