Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dependencies in a clojurescript with leiningen

I am seriously pulling my hair right now! I am a total noob at clojure: I can't seem to be able to get a simple clojurescript compilation done without this error:

ERROR: JSC_MISSING_PROVIDE_ERROR. required "clojure.core.async" namespace never provided at /home/jldupont/workspace/$someproject/target/cljsbuild-compiler-0/domain2/main.js line 4 : 0

I've got the following project.clj file:

(defproject $someproject "0.1"
  :description "some project..."
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/clojurescript "0.0-2030"]
                 [org.clojure/core.async "0.1.267.0-0d7780-alpha"]                 
                ]
  :plugins [[lein-cljsbuild "0.3.2"]]
  :cljsbuild {
              :builds [{:id "domain2"
                        :source-paths ["src/cljs/model2/domain"]
                        :compiler {:output-to      "src/assets/js/model2/domain/domain2.js"
                                   :optimizations :advanced
                                   :pretty-print   true}
                       }
                      ]
            }
)

Everytime I use lein cljsbuild auto I get the error quoted above.

Please help!

Update

I've looked in my ~/.m2 directory and the dependencies ( in this case core.async ) are present.

Update 2

It would appear that it is the Google Closure Compiler that spews out this error message. Not sure how to provide it a path to the dependencies...

like image 993
jldupont Avatar asked Mar 20 '23 19:03

jldupont


1 Answers

As mentioned in my comment above: if you want to use core.async with ClojureScript you have to require the namespace cljs.core.async (instead of Clojure's clojure.core.async).

like image 189
xsc Avatar answered Apr 01 '23 08:04

xsc