ClojureScript

cljs.main: Watch with Node fails regarding :main

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    {:deps {org.clojure/clojurescript {:mvn/version "1.10.217"}}}

Description

src/hello_world/core.cljs
(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

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: