I was trying to go through Quick Start with the latest ClojureScript (1.10.741), but ran into some problems.
moon:hello-world lark$ clj --main cljs.main --compile hello-world.core --repl
ClojureScript 1.10.741
cljs.user=>
cljs.user=> (js/alert "Hello CLJS!")
nil
cljs.user=> (require '[hello-world.core :as hello] :reload)
nil
cljs.user=> (hello/average 20 13)
Execution error (TypeError) at (<cljs repl>:1).
Cannot read property 'call' of undefined
cljs.user=> (dir hello)
average
nil
cljs.user=> (source hello)
Source not found
nil
cljs.user=>
First, sometimes it doesn't print "Hello World" as you can see above.
Second, when I added average function and tried to call it after reloading I got an execution error (constantly reproducible).
Also the node build throws an error:
moon:hello-world lark$ clj -m cljs.main --target node --output-to main.js -c hello-world.core
moon:hello-world lark$ node main.js
/Users/lark/code/learn/cljs/clojurescript.org/hello-world/out/goog/dom/dom.js:2499
this.document_ = opt_document || goog.global.document || document;
^
ReferenceError: document is not defined
at new goog.dom.DomHelper (/Users/lark/code/learn/cljs/clojurescript.org/hello-world/out/goog/dom/dom.js:2499:60)
at Object.goog.dom.getDomHelper (/Users/lark/code/learn/cljs/clojurescript.org/hello-world/out/goog/dom/dom.js:87:38)
at new goog.net.xpc.CrossPageChannel (/Users/lark/code/learn/cljs/clojurescript.org/hello-world/out/goog/net/xpc/crosspagechannel.js:94:47)
at Function.clojure.browser.net/xpc-connection [as cljs$core$IFn$_invoke$arity$1] (/Users/lark/code/learn/cljs/clojurescript.org/hello-world/out/clojure/browser/net.cljs:117:1)
at clojure$browser$net$xpc_connection (/Users/lark/code/learn/cljs/clojurescript.org/hello-world/out/clojure/browser/net.cljs:117:1)
at clojure$browser$repl$connect (/Users/lark/code/learn/cljs/clojurescript.org/hello-world/out/clojure/browser/repl.cljs:233:9)
at Object.<anonymous> (/Users/lark/code/learn/cljs/clojurescript.org/hello-world/out/clojure/browser/repl/preload.cljs:13:3)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
moon:hello-world lark$
In this case core.cljs looks as following:
(ns hello-world.core)
(println "Hello world!")
All listed above works well with 1.10.520.