Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

(ns hello-world.core)

If you

clj -m cljs.main -re node -v -c hello-world.core -r

the verbose logging will show that the compiler options includes

:main hello-world.core

but if you simply add {{-w src}}:

clj -m cljs.main -re node -v -w src -c hello-world.core -r

then {{out/watch.log}} will show that an assert is triggered:

Building ...
java.lang.AssertionError: Assert failed: :nodejs target with :none optimizations requires a :main entry
(not (and (= target :nodejs) (= optimizations :none) (not (contains? opts :main))))

at cljs.closure$check_node_target.invokeStatic(closure.clj:2068)
at cljs.closure$check_node_target.invoke(closure.clj:2065)
at cljs.closure$build.invokeStatic(closure.clj:2735)
at cljs.closure$build.invoke(closure.clj:2697)
at cljs.closure$watch$buildf__5939.invoke(closure.clj:2907)
at cljs.closure$watch.invokeStatic(closure.clj:2939)
at cljs.closure$watch.invoke(closure.clj:2883)
at cljs.repl$repl_STAR_$fn__6536$fn__6541.invoke(repl.cljc:983)
at clojure.core$binding_conveyor_fn$fn__5476.invoke(core.clj:2022)
at clojure.lang.AFn.run(AFn.java:22)
at java.lang.Thread.run(Thread.java:748)

Watching paths: /private/tmp/watch-noisy/src

1 Answer

0 votes
Reference: https://clojure.atlassian.net/browse/CLJS-2684 (reported by mfikes)