Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clojurescript libraries - goog.require could not find

New to clojurescript, and working through the "Modern CLJS" tutorial here.

It instructs to pull in domina by adding it to the project.clj:

:dependencies [[org.clojure/clojure "1.4.0"]
               [compojure "1.1.5"]
               [domina "1.0.0"]]

And then use it in your script by referencing it in the ns form

(ns cljstut.login
  (:use [domina :only [by-id value]]))

However, when I actually run this in a browser, I see the following in the console log.

goog.require could not find: domina

Seems like I'm missing some declaration somewhere? But as a newb, this whole build process is rather opaque. Any troubleshooting tips are greatly appreciated.

like image 744
BnWasteland Avatar asked Feb 25 '13 01:02

BnWasteland


3 Answers

Dependencies in your project.clj file and your namespace declarations look fine.

If you are building your clojurescript code using lein cljsbuild auto, you will need to restart that process. I believe it should automatically pull in new dependencies after a restart.

If that doesn't work, or you aren't using lein cljsbuild auto, try running the lein deps command inside your project's folder manually - it will fetch all missing dependencies from remote repositories.

like image 180
mtyaka Avatar answered Dec 26 '22 14:12

mtyaka


Also, make sure you have saved your project.clj file and try running lein clean and lein cljsbuild clean.

like image 45
Sarien Avatar answered Dec 26 '22 15:12

Sarien


I'm in the process of updating modern-cljs to the latest versions of the used libs and lein plugins. At the moment I updated the series up to the 7th tutorial of the series. You should now be safe by updating to domina 1.0.2-SNAPSHOT into project.cljs :dependencies and to lein-cljsbuild 0.3.0 into project.cljs :plugins.

Mimmo

like image 32
Magomimmo Avatar answered Dec 26 '22 15:12

Magomimmo