As Jared314 and Zubair pointed out, the problem you are facing is caused by an attempt to include two clojurescript compilation outputs in the same page. Clojurescript / Google Closure is waiting for the compilation of "the whole world", that is, the compiler expects that all the code for the entire page will be passed to the compiler so that it can optimize it, rename functions and ultimately spit out one javascript file. It is not intended to create multiple output files that work together.
The “right” way to solve your problem is to create two outputs that are used in isolation: the main.js file to run your application and the spec.js file, which includes all the code mainly plus the code in for testing. You can do this by setting up your project something like this:
:cljsbuild { :builds [{ :source-paths ["src/clojurescript"] :compiler {:output-to "public/javascripts/main.js"}} { :source-paths ["src/clojurescript" "spec/clojurescript"] :compiler {:output-to "spec/javascripts/spec.js"}}]})
Your jasmine page should link to spec.js, but not main.js - a link to both is the cause of your error.
source share