This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-26
Channels
- # announcements (10)
- # aws (5)
- # babashka (27)
- # beginners (175)
- # boot (1)
- # braveandtrue (2)
- # calva (11)
- # cider (13)
- # clj-kondo (91)
- # cljs-dev (54)
- # cljsrn (20)
- # clojure (164)
- # clojure-gamedev (3)
- # clojure-uk (43)
- # clojurescript (185)
- # core-async (6)
- # core-typed (1)
- # cursive (1)
- # docker (2)
- # emacs (2)
- # figwheel-main (78)
- # fulcro (69)
- # off-topic (20)
- # pathom (30)
- # planck (3)
- # re-frame (6)
- # reagent (70)
- # reitit (26)
- # ring (1)
- # shadow-cljs (120)
- # tools-deps (6)
- # vim (9)
I'm using the new bundle option with the cli -w src
and getting:
Change detected, recompiling ...
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:2352)
at cljs.closure$check_node_target.invoke(closure.clj:2349)
at cljs.closure$validate_opts.invokeStatic(closure.clj:3017)
at cljs.closure$validate_opts.invoke(closure.clj:3011)
at cljs.closure$build.invokeStatic(closure.clj:3059)
at cljs.closure$build.invoke(closure.clj:3023)
at cljs.closure$watch$buildf__6288.invoke(closure.clj:3276)
at cljs.closure$watch.invokeStatic(closure.clj:3344)
at cljs.closure$watch.invoke(closure.clj:3246)
at cljs.repl$repl_STAR_$fn__6922$fn__6927.invoke(repl.cljc:1193)
at clojure.core$binding_conveyor_fn$fn__5754.invoke(core.clj:2030)
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.lang.Thread.run(Thread.java:834)
The error makes me think that maybe it's intentional that it doesn't work, but I'm not sure with the whole nodejs thing in there...Ah, easy one. add-implicit-options
changes the target to be :nodejs
, and that is what is validated against, instead of what I actually used.
Should the watch option be usable with :bundle?
seems like the quickstart guide's sample node application is broken on 742 right now. https://clojure.atlassian.net/browse/CLJS-3237
@dnolen clj -m cljs.main -co build.edn -w src -c -r
with:
{:main io.dominic.hxadapound.core
:output-to "out/index.js"
:output-dir "out"
:target :bundle
:bundle-cmd {:none ["npx" "webpack" "--mode=development"]
:default ["npx" "webpack"]}}
@dominicm looks fine, can you file a JIRA w/ just that config? thanks - fine to mark major
@dnolen I'm also getting a similar error - missing main file for nodejs - when trying to use :modules
. I also tried adding :nodejs-rt false
to no avail. Is combining :bundle
with :modules
an intended use-case?
@john :bundle
+ :modules
is not expected to work (because not tested, not intentionally) and no specific timeline for when it will
I'm looking at the main
issue today so at that won't obfuscate the problem if there is one
but the idea is that code splitting the node_modules
beneath the top-level stuff is impractical
anyways code splitting is definitely meant to work with bundle - but I'm happy to see somebody else work on it
I mean I'll try, but the JS stuff is still a little alien to me. If nothing else I'll try to get the ball pushed down the road a bit.
@john fixed a few things - not sure if it will matter for the :modules
stuff happy to take a report now
you probably want --no-color
in your webpack command to make that slightly easier to look at
> This also means you can start a node REPL now with clj -m cljs.main -t node -r
big fan of not needed --re if you set the target. i mixed that up a few times and its always confusing for a second
Where did you get the quote?
commit message for the fix for https://clojure.atlassian.net/browse/CLJS-3237 https://github.com/clojure/clojurescript/commit/6c3276e3248c7e1b9fa3a6d00cffe77ad2860853