We're updating the issue view to help you get more done. 

cljs.main: Watch with Node fails regarding :main

Description

src/hello_world/core.cljs

1 (ns hello-world.core)

If you

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

the verbose logging will show that the compiler options includes

1 :main hello-world.core

but if you simply add -w src:

1 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:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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

Environment

{:deps {org.clojure/clojurescript {:mvn/version "1.10.217"}}}

Status

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Priority

Major