boot-clj / boot-cljs

Boot task to compile ClojureScript programs.
Eclipse Public License 1.0
176 stars 40 forks source link

Error recompiling in Windows #109

Closed ahwatts closed 9 years ago

ahwatts commented 9 years ago

I'm getting an error with version 1.7.170-3 when the file watcher triggers a recompile:

Writing main.cljs.edn...
Compiling ClojureScript...
ò main.js
adzerk.boot_cljs.util.proxy$clojure.lang.ExceptionInfo$ff19274a: No such namespace: murkier..#gl-matrix, could not locate murkier//_SHARP_gl_matrix.cljs, murkier//_SHARP_gl_matrix.cljc, or Closure namespace "murkier..#gl-matrix"
    data: {:tag :cljs/analysis-error, :from :boot-cljs}
               clojure.core/ex-info       core.clj: 4593
    adzerk.boot-cljs.impl/handle-ex       impl.clj:   60
 adzerk.boot-cljs.impl/compile-cljs       impl.clj:   97
                                ...
                 clojure.core/apply       core.clj:  630
              boot.pod/eval-fn-call        pod.clj:  184
                  boot.pod/call-in*        pod.clj:  191
                                ...
                  boot.pod/call-in*        pod.clj:  194
           adzerk.boot-cljs/compile  boot_cljs.clj:   71
      adzerk.boot-cljs/compile-1/fn  boot_cljs.clj:  125
clojure.core/binding-conveyor-fn/fn       core.clj: 1916
                                ...
Elapsed time: 0.225 sec

Writing main.cljs.edn...
Compiling ClojureScript...
ò main.js
Elapsed time: 1.102 sec

In this case, after running my "boot dev" task, I touched src/murkier/gl_matrix.cljs, which triggered a rebuild.

My build.boot looks like this:

(set-env!
 :source-paths #{"src"}
 :resource-paths #{"html"}
 :dependencies '[[adzerk/boot-cljs          "1.7.170-3"      :scope "test"]
                 [adzerk/boot-cljs-repl     "0.2.0"          :scope "test"]
                 [adzerk/boot-reload        "0.4.1"          :scope "test"]
                 [pandeiro/boot-http        "0.7.0-SNAPSHOT" :scope "test"]
                 [org.clojure/clojure       "1.7.0"]
                 [org.clojure/clojurescript "1.7.145"]
                 ;; [cljs-webgl                "0.1.5-SNAPSHOT"]
                 [cljsjs/gl-matrix          "2.3.0-jenanwise-0"]
                 [prismatic/dommy           "1.1.0"]
                 [camel-snake-kebab         "0.3.2"]])

(require '[adzerk.boot-cljs :refer [cljs]]
         '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
         '[adzerk.boot-reload :refer [reload]]
         '[pandeiro.boot-http :refer [serve]])

(deftask dev []
  (comp (serve :dir "target/" :port 5000)
        (watch)
        ;; (speak)
        (reload :on-jsload 'murkier.main/start)
        (cljs-repl)
        (cljs :optimizations :none :source-map true)))

(deftask build []
  (comp (cljs :optimizations :advanced :source-map true)))

If I change nothing else but drop the boot-cljs version back to 1.7.166-1, I don't get this error. It only appears to happen on Windows; I've also tried it on Linux and haven't gotten this error.

ahwatts commented 9 years ago

I just realized that it's trying to recompile the Emacs auto-save file, which gets called something like (in this case) .#gl_matrix.cljs. Which explains why the rebuild would eventually work.

Deraen commented 9 years ago

You should configure your editor to save auto-save and other temp files in some other place. Or at minimum to use other, non-cljs, file extension.

ahwatts commented 9 years ago

True. I'm not sure why it was "working" in older versions, but that could be something about my Emacs setup. But since the file goes away and the stuff gets rebuilt correctly afterwards, this seems to be a mostly cosmetic issue. I'll close it, unless you want to keep it open for some reason.