This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-03
Channels
- # aleph (3)
- # announcements (2)
- # babashka (24)
- # beginners (71)
- # biff (5)
- # calva (19)
- # cider (7)
- # clj-kondo (15)
- # cljdoc (3)
- # clojure (76)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-denver (24)
- # clojure-europe (56)
- # clojure-filipino (1)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (37)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojure-uk (6)
- # clojurescript (2)
- # cursive (2)
- # datalevin (71)
- # datomic (9)
- # dev-tooling (5)
- # emacs (19)
- # events (1)
- # gratitude (1)
- # hoplon (6)
- # introduce-yourself (5)
- # jobs (1)
- # juxt (2)
- # lsp (23)
- # nbb (26)
- # off-topic (12)
- # other-languages (97)
- # practicalli (2)
- # releases (2)
- # remote-jobs (1)
- # shadow-cljs (24)
- # tools-deps (17)
- # vim (2)
Does this make sense to anyone?
clojure -M:shadow-cljs watch :app (git)-[main]- 0 chris:~$
Execution error (AssertionError) at shadow.undertow/eval19650$fn (undertow.clj:163).
Assert failed: (.exists root-dir)
Looks like you're invoking shadow-cljs incorrectly. When using Clojure CLI you need to run shadow.cljs.devtools.cli watch app
@hifumi123 thats what the -M:shadow-cljs
alias likely does
open your shadow-cljs.edn
. look for configured paths. there might be :dev-http
? the assert is shit, so its not really helping but its just telling you that a directory it expected doesn't exist
what doesn't work about npm? could just be your filesystem being wonky for some reason. are you running in some kind of docker or so container?
{:deps {:aliases [:shadow-cljs]}
:nrepl {:port 10000}
:dev-http {10001 ["/Volumes/RAMDisk/dumdom1" "classpath:public"]
10002 "out/test"}
:builds
{:app {:target :browser
:output-dir "/Volumes/RAMDisk/dumdom1/js"
:modules {:main {:init-fn }}
:release {:output-dir "dist/js"
:compiler-options {:infer-externs :auto
:optimizations :advanced}}}}}
under normal circumstances it will try to created this directory if it doesn't exist. but that seems to fail
FWIW you don't need those :compiler-options
. those are the defaults, no need to repeat them
Hello everyone. I have a case of google closure mangling the keys of an object. There is a JS file in my path /src/js/my-fork.js
, which is a fork from another library.
There, there is an object that looks like this:
const myObj = {
target: null, // will be a dom element
add(target, options) {
this.target = target;
if (target) {
let defaultOptions = {
key1:1,
key2:2,
};
// ...
target.options = {...defaultOptions, options}
}
}
}
The add
method is called from the CLJS side, but the defaultOptions
keys are mangled in the advanced build. So the passed in options are ignored because the keys do not correspond to the mangled keys.
I am not entirely sure how to deal with this case in an elegant way.
EDIT: Just added the keys to an externs/my-build.txt file, and it worked. Is that the best way?yes, there is no externs inference for JS files. so this gets renamed without externs.
or not include this via the classpath JS option, by putting it into node_modules/your-thing
and include it like a regular JS lib
I see, thanks.