This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-31
Channels
- # architecture (1)
- # babashka (17)
- # calva (18)
- # cider (5)
- # clj-kondo (5)
- # cljdoc (44)
- # cljs-dev (2)
- # clojure (49)
- # clojure-europe (11)
- # clojure-norway (16)
- # clojure-uk (3)
- # clojurescript (89)
- # clr (8)
- # conjure (7)
- # cursive (26)
- # data-science (2)
- # datomic (15)
- # emacs (11)
- # events (1)
- # fulcro (8)
- # gratitude (3)
- # hyperfiddle (68)
- # introduce-yourself (1)
- # london-clojurians (1)
- # lsp (3)
- # nbb (8)
- # pathom (44)
- # pedestal (14)
- # polylith (2)
- # random (1)
- # shadow-cljs (8)
- # spacemacs (13)
- # squint (36)
- # tools-deps (9)
- # xtdb (17)
Hello 👋:skin-tone-2: I’m seeing a difference in behavior between cli and bb tasks and am curious why. I build my cljs like so.
clojure -T:build build-cljs
This works as expected when running in the terminal.
I define a bb
task to run the same thing.
cljs:build-prod {:doc "build release CLJS"
:task (clojure {:dir "."} "-T:build build-cljs")}
And run it.
bb run cljs:build-prod
Exception in thread "main" Syntax error macroexpanding at (user.clj:1:1).
at clojure.lang.Compiler.load(Compiler.java:7648)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:368)
at clojure.lang.RT.maybeLoadResourceScript(RT.java:364)
at clojure.lang.RT.doInit(RT.java:486)
at clojure.lang.RT.init(RT.java:467)
at clojure.main.main(main.java:38)
Caused by: java.io.FileNotFoundException: Could not locate sc/api__init.class, sc/api.clj or sc/api.cljc on classpath.
...
Now, I have require sc.api
in a user.clj
file that is present only when the :dev
alias is enabled. Afaict, that alias is not enabled here. Any idea why this may be happening?{:dir "."}
isn't necessary when you are already in the current directory, not sure why you added it
perhaps try erasing .cpcache
and re-run. else, create a repro and I'd be happy to clone and debug
fwiw, I believe this is where it was originally from https://github.com/kit-clj/kit/blob/master/libs/deps-template/resources/io/github/kit_clj/kit/bb.edn
So you’re going to laugh… 😅 I’m new to bb
. I jumped to the task runner docs in the book and copied https://book.babashka.org/#_introduction: bb run clean
. I assumed the syntax for running commands was the same as npm
. e.g., to run a named task, you do bb run [task]
. The kit template I copied happened to define a task _named_ run!!
run {:doc "starts the app"
:task (if (fs/windows?)
(clojure {:dir "."} "-M:dev")
(shell {:dir "."} "clj -M:dev"))}
This task enabled the :dev
alias which added my dev user.clj
to the cp, resulting in this error.
Weird set of things. I have my answer now — delete the run
task.