我正在编译:
(ns example.hello)
(js/console.log "Hello from ClojureScript!")
使用此配置:
(defproject lein-cljsbuild-example "1.2.3"
:plugins [[lein-cljsbuild "0.2.9"]]
:cljsbuild {
:builds [{
:source-path "src-cljs"
:compiler {
:output-to "war/javascripts/mainz.js" ; default: main.js in current directory
;:optimizations :simple
:target :nodejs
;:pretty-print true
}}]})
它输出的文件太大而无法放在这里,但给出了错误:
goog.debug.Error = function(opt_msg) {
^
TypeError: Cannot set property 'Error' of undefined
at Object.<anonymous> (/Users/myuser/Clojure/cljstest/war/javascripts/mainz.js:503:18)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)