This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-02
Channels
- # announcements (25)
- # babashka (76)
- # beginners (74)
- # biff (36)
- # calva (11)
- # cider (5)
- # clerk (43)
- # cljs-dev (4)
- # cljsrn (12)
- # clojure (111)
- # clojure-austin (14)
- # clojure-europe (82)
- # clojure-nl (2)
- # clojure-norway (5)
- # clojure-uk (1)
- # clojurescript (36)
- # core-async (13)
- # cursive (30)
- # datomic (12)
- # fulcro (6)
- # honeysql (9)
- # hyperfiddle (73)
- # instaparse (3)
- # introduce-yourself (1)
- # jobs (1)
- # membrane (40)
- # nbb (2)
- # off-topic (6)
- # other-languages (8)
- # polylith (33)
- # reagent (2)
- # reitit (7)
- # rum (7)
- # shadow-cljs (47)
- # tools-deps (10)
- # vim (11)
- # xtdb (16)
I am getting an error when running bb dev, testing out the eelchat code on my laptop. It was working but has stopped working. Error below. I'm not sure how to debug this:
bb dev
Rebuilding...
Done in 120ms.
Execution error (FileNotFoundException) at clojure.main/main (main.java:40).
Could not locate __init.class, .clj or .cljc on classpath.
Full report at:
/var/folders/lv/zql5shxs6j75gfp84cgfmm240000gn/T/clojure-1878455090635687364.edn
Error while executing task: dev
Ah, the full report referred to is:
{:clojure.main/message
"Execution error (FileNotFoundException) at clojure.main/main (main.java:40).\nCould not locate __init.class, .clj or .cljc on classpath.\n",
:clojure.main/triage
{:clojure.error/class java.io.FileNotFoundException,
:clojure.error/line 40,
:clojure.error/cause
"Could not locate __init.class, .clj or .cljc on classpath.",
:clojure.error/symbol clojure.main/main,
:clojure.error/source "main.java",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type java.io.FileNotFoundException,
:message
"Could not locate __init.class, .clj or .cljc on classpath.",
:at [clojure.lang.RT load "RT.java" 462]}],
:trace
[[clojure.lang.RT load "RT.java" 462]
[clojure.lang.RT load "RT.java" 424]
[clojure.core$load$fn__6908 invoke "core.clj" 6161]
[clojure.core$load invokeStatic "core.clj" 6160]
[clojure.core$load doInvoke "core.clj" 6144]
[clojure.lang.RestFn invoke "RestFn.java" 408]
[clojure.core$load_one invokeStatic "core.clj" 5933]
[clojure.core$load_one invoke "core.clj" 5928]
[clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
[clojure.core$load_lib invokeStatic "core.clj" 5974]
[clojure.core$load_lib doInvoke "core.clj" 5953]
[clojure.lang.RestFn applyTo "RestFn.java" 142]
[clojure.core$apply invokeStatic "core.clj" 669]
[clojure.core$load_libs invokeStatic "core.clj" 6016]
[clojure.core$load_libs doInvoke "core.clj" 6000]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.core$apply invokeStatic "core.clj" 669]
[clojure.core$require invokeStatic "core.clj" 6038]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]],
:cause "Could not locate __init.class, .clj or .cljc on classpath."}}
java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment Homebrew (build 19.0.2)
OpenJDK 64-Bit Server VM Homebrew (build 19.0.2, mixed mode, sharing)
Using an M1 Macbook.
hm, looks like the main namespace being passed to clojure isn't there. what does bb run-args
print out?
bb run-args
----- Error --------------------------------------------------------------------
Type: java.lang.Exception
Message: File does not exist: run-args
Oh, forgot that's just a function, not a task you can call with bb. What's the contents of config.edn (the :tasks section specifically)?
(On the process for debugging this: the source code for bb tasks in here: https://github.com/jacobobryant/biff/blob/master/tasks/src/com/biffweb/tasks.clj#L128 -- the last command in the dev
task basically just calls clj and passes the result of (run-args)
as the parameters. and (run-args)
just returns the value of the :biff.tasks/clj-args
option in config.edn.)
bb run-cmd
clj -J-XX:-OmitStackTraceInFastThrow -M -m nil --port 7888 --middleware [cider.nrepl/cider-middleware]
ah yes, the -M -m nil
is the problem. probably need to make a change to config.edn
(it should be e.g. -M -m com.eelchat
, or whatever your main namespace is)
strange that it worked previously
what's the current contents of config.edn?
;; vim: ft=clojure
{:prod {:biff.xtdb/dir "storage/xtdb"
:biff.xtdb/topology :standalone
;; Standalone topology in production isn't recommended for anything
;; serious. You can uncomment the following to use managed postgres
;; instead.
;; :biff.xtdb/topology :jdbc
;; :biff.xtdb.jdbc/jdbcUrl ":port/dbname?sslmode=require"
:biff/base-url ""
;; Postmark is used to send email sign-in links. Create an account at
;;
:postmark/api-key nil
;; Change to the address of your sending identity. Set a reply-to
;; address on your sending identity if you want to receive replies and
;; your from address isn't configured for receiving.
:postmark/from ""
;; Recaptcha is used to protect your sign-in page. Go to
;; and add a site. Select v2
;; invisible. Add localhost to your list of allowed domains.
:recaptcha/site-key nil
:recaptcha/secret-key nil
:biff.middleware/cookie-secret "CLqrhUIs3ognUgE2L0MzlQ=="
:biff/jwt-secret "EKYVphKYh0eprK6K/7HPsrMH22MgkcRRgHxHj8w+YXk="}
:dev {:merge [:prod]
:com.eelchat/enable-beholder true
:biff/host "0.0.0.0"
:biff/port 8080
:biff/base-url ""
:biff.xtdb/topology :standalone
:biff.middleware/secure false}
:tasks {;; Set this if the auto-detection doesn't work
;; Possible values: macos-x64, macos-arm64, linux-x64, linux-arm64
:biff.tasks/tailwind-build nil
:biff.tasks/clj-args ["-J-XX:-OmitStackTraceInFastThrow"
"-J-XX:+CrashOnOutOfMemoryError"
"-M" "-m" "com.eelchat"
"--port" "7888"
"--middleware" "[cider.nrepl/cider-middleware,refactor-nrepl.middleware/wrap-refactor]"]
:biff.tasks/soft-deploy-fn com.eelchat/on-save
;; Uncomment this if your primary branch is called main instead of master.
;:biff.tasks/deploy-cmd ["git" "push" "prod" "main:master"]
:biff.tasks/deploy-cmd ["git" "push" "prod" "master"]
:biff.tasks/server ""}}
what's the contents of tasks/deps.edn
? config.edn looks correct. maybe it's something to do with the biff version...
{:paths ["src"]
:deps {com.biffweb/tasks {:git/url "" :sha "9d725ba74514032b3a6f86affe16f8d3c9693135" :deps/root "tasks"}}}
I used this command to set up the project:
bb -e "$(curl -s )" tutorial
then I have been overwriting tracked files with contents of repo
at different commits
git remote -v
origin (fetch)
origin (push)
great to have such quick response from the author!!
biff seems great, very interesting, thanks for putting htmx on my radar
ah, that could do it. The bb -e "$(curl -s
actually uses a somewhat more recent version of biff than what's on that repo. So in doing that you've ended up downgrading the biff version in deps.edn (and more importantly, tasks/deps.edn) to an older version than what your project was created with. And the reason that causes problems is because the config.edn file (which isn't tracked by git) was generated by the new version of biff, and that causes a compatibility problem (new code is compatible with old config, but not always the other way around).
I think it'll work if you just set the last section of config.edn
to this:
:tasks {;; Set this if the auto-detection doesn't work
;; Possible values: macos-x64, macos-arm64, linux-x64, linux-arm64
:biff.tasks/tailwind-build nil
:biff.tasks/main-ns com.eelchat
:biff.tasks/soft-deploy-fn com.eelchat/on-save
:biff.tasks/deploy-from "master"
:biff.tasks/deploy-to "prod"
:biff.tasks/server ""}
You're welcome!
similar issues have come up before -- I'm gonna push a config.edn.TEMPLATE
file to the eelchat repo; so anyone going off the repo version of eelchat can just use that
(if you deploy eelchat, replace
in that snippet with your own domain)
thanks a lot for the emergency resuscitation
will continue investigating how you have web sockets working with htmx
(also another note--I was actually a bit careless in having you paste config.edn, since it contains some secrets, jwt-secret and cookie-secret. newer versions of biff keep the secrets in secrets.env, so config.edn is safe to paste for new projects. in any case since it's just a tutorial, probably no big deal, but fyi for future reference!)
which is what I'm poking around to look at
am just using on local development machine
sounds good, let me know if you have any questions about that. this thread might be useful: https://clojurians.slack.com/archives/C013Y4VG20J/p1676576376740459