This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-22
Channels
- # aleph (5)
- # announcements (5)
- # babashka (8)
- # beginners (63)
- # biff (43)
- # calva (17)
- # clj-kondo (76)
- # clojure (105)
- # clojure-europe (77)
- # clojure-nl (1)
- # clojure-norway (40)
- # clojure-uk (4)
- # clojuredesign-podcast (20)
- # clojurescript (35)
- # clr (7)
- # cursive (5)
- # data-science (1)
- # datomic (41)
- # fulcro (14)
- # hyperfiddle (22)
- # malli (12)
- # off-topic (17)
- # re-frame (6)
- # reitit (3)
- # releases (1)
- # ring (2)
- # scittle (1)
- # shadow-cljs (6)
- # specter (3)
- # xtdb (3)
I have some problem with reload/refresh with Biff 1.8.1 on mac os. When i change something (e.g. the Text on the Sign Up Button) i only get the new html after i have killed the clj -M:dev dev
I also tried a main/refresh
then i get in the console:
[nREPL-session-53c1780e-adf9-43f1-82fc-d32cd0f9fc2a] INFO ch.fabianpage - stopping: com.biffweb.impl.misc$use_beholder$fn__28640@345f491a
[nREPL-session-53c1780e-adf9-43f1-82fc-d32cd0f9fc2a] INFO ch.fabianpage - stopping: com.biffweb.impl.misc$use_chime$fn__28697$fn__28701@207cd8cc
[nREPL-session-53c1780e-adf9-43f1-82fc-d32cd0f9fc2a] INFO ch.fabianpage - stopping: com.biffweb.impl.misc$use_jetty$fn__28673@7817afb0
[nREPL-session-53c1780e-adf9-43f1-82fc-d32cd0f9fc2a] INFO org.eclipse.jetty.server.Server - Stopped Server@12c33c39{STOPPING}[10.0.7,sto=0]
[nREPL-session-53c1780e-adf9-43f1-82fc-d32cd0f9fc2a] INFO org.eclipse.jetty.server.AbstractConnector - Stopped ServerConnector@1ffd3bbc{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
[nREPL-session-53c1780e-adf9-43f1-82fc-d32cd0f9fc2a] INFO org.eclipse.jetty.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@54775f19{/,null,STOPPED}
[nREPL-session-53c1780e-adf9-43f1-82fc-d32cd0f9fc2a] INFO ch.fabianpage - stopping: com.biffweb.impl.xtdb$use_tx_listener$fn__25878@69f182d0
[nREPL-session-53c1780e-adf9-43f1-82fc-d32cd0f9fc2a] INFO ch.fabianpage - stopping: com.biffweb.impl.queues$use_queues$fn__32212@3eda75f1
[nREPL-session-53c1780e-adf9-43f1-82fc-d32cd0f9fc2a] INFO ch.fabianpage - stopping: com.biffweb.impl.xtdb$use_xt$fn__25843@386eaa96
[nREPL-session-53c1780e-adf9-43f1-82fc-d32cd0f9fc2a] INFO xtdb.tx - Shut down tx-ingester
after that the nrepl doesn't work anymore and also the web request doesn't return anymore
In the nrepl i get:
; eval (root-form): (main/refresh)
; (out) :reloading (clojure.tools.build.util.log clojure.tools.deps.alpha.specs clojure.tools.deps.alpha.util.concurrent clojure.tools.deps.alpha.util.session clojure.tools.deps.alpha.extensions clojure.tools.deps.alpha.util.dir clojure.tools.deps.alpha clojure.tools.deps.alpha.script.print-tree clojure.tools.deps.alpha.extensions.git clojure.tools.build.util.file clojure.tools.build.util.zip clojure.tools.build.api.specs clojure.tools.build.api clojure.tools.build.tasks.jar clojure.tools.build.tasks.copy clojure.tools.deps.alpha.tool clojure.tools.deps.alpha.script.parse clojure.tools.deps.alpha.util.s3-transporter clojure.tools.deps.alpha.util.maven clojure.tools.deps.alpha.gen.pom clojure.tools.deps.alpha.tree clojure.tools.deps.alpha.script.make-classpath2 clojure.tools.deps.alpha.script.generate-manifest2 com.biffweb.task-runner.lazy com.biffweb.tasks.lazy.clojure.string com.biffweb.tasks.lazy.clojure.java.shell com.biffweb.tasks.lazy.babashka.process com.biffweb.tasks.lazy.nextjournal.beholder com.biffweb.tasks.lazy.babashka.fs com.biffweb.tasks.lazy.com.biffweb.config com.biffweb.task-runner.lazy.clojure.string com.biffweb.task-runner com.biffweb.tasks.lazy.nrepl.cmdline com.biffweb.tasks.lazy.clojure.tools.build.api com.biffweb.tasks.lazy.clojure.stacktrace com.biffweb.tasks.lazy.hato.client com.biffweb.tasks com.biffweb.impl.time clojure.tools.deps.alpha.extensions.deps clojure.tools.deps.alpha.repl com.biffweb.impl.util com.biffweb.impl.util.ns com.biffweb.impl.xtdb com.biffweb.impl.queues com.biffweb.impl.misc com.biffweb.impl.middleware com.biffweb.impl.util.s3 com.biffweb.config com.biffweb.impl.rum com.biffweb.impl.auth com.biffweb.impl.util.reload com.biffweb.impl.htmx-refresh com.biffweb ch.fabianpage.settings ch.fabianpage.ui ch.fabianpage.middleware ch.fabianpage.home ch.fabianpage.worker ch.fabianpage.schema ch.fabianpage.email ch.fabianpage repl clojure.tools.build.tasks.javac clojure.tools.build.tasks.install ch.fabianpage-test clojure.tools.build.tasks.process clojure.tools.build.tasks.compile-clj tasks clojure.tools.build.tasks.create-basis clojure.tools.deps.alpha.extensions.pom clojure.tools.deps.alpha.extensions.local clojure.tools.deps.alpha.util.s3-aws-client clojure.tools.build.tasks.uber clojure.tools.deps.alpha.extensions.maven clojure.tools.build.tasks.zip clojure.tools.deps.alpha.script.resolve-tags clojure.tools.build.tasks.write-pom clojure.tools.cli.api)
; (out) :error-while-loading ch.fabianpage
:done
at the end of the nrepl output I see there's a :error-while-loading ch.fabianpage
message. if you eval that namespace via the repl do you see any errors?
if there is a compilation error, ideally you'd be getting a stack trace somewhere + a notification in the browser window, so that might need to investigate that
But i reproduced the error with a new tutorial project. Will try it out also with an not tutorial project.
hmm, interesting. I just tried starting a new tutorial project (at the moment it should be the same as a non-tutorial project anyway) as a sanity check and I didn't get the error myself. So if you:
1. create a new project
2. run clj -M:dev dev
3. open the signup page at
4. open src/com/example/settings.clj
and change "My Application"
to something else, then save the file
Does the signup page auto-refresh and display the new string? or at least display the new string if you manually refresh the web page?
I wonder if there could be some problem on Mac? (I'm on Windows + WSL, so those two platforms are easy for me to test on, but Mac is a little less convenient.) Could someone else with a Mac try creating a new project (`clj -M -e '(load-string (slurp "https://biffweb.com/new.clj"))'`) and change some files and verify that the changes take effect without errors?
Hi Jacob, …I did just that on my M1 Mac and it worked fine. I ran your command to create an app; then clj -M:dev dev
to start it; browsed to it using Safari; edited the home-page
and saw the expected result in Safari; no errors in terminal/console. Let me know if you want any other detail.
awesome, thanks for checking that.
Happy to help debug--hopefully shouldn't be too hard to figure out.
Just to add, my M1 has…
$ clj --version
Clojure CLI version 1.11.1.1386
$ uname -a
Darwin zinc.lan 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8103 arm64
❯ java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment Zulu19.32+13-CA (build 19.0.2+7)
OpenJDK 64-Bit Server VM Zulu19.32+13-CA (build 19.0.2+7, mixed mode, sharing)
❯ uname -a
Darwin MacBook-Pro-von-Fabian.local 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:31:00 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6020 arm64
I changed the logging level by adding
"-Dorg.slf4j.simpleLogger.defaultLogLevel=debug"
When saving a file i get:
Rebuilding...
Done in 18ms.
[ForkJoinPool.commonPool-worker-1] DEBUG io.methvin.watcher.DirectoryWatcher - ENTRY_MODIFY [/Users/fabian/tmp/asdf/src/ch/asdf/home.clj]
[ForkJoinPool.commonPool-worker-1] DEBUG io.methvin.watcher.DirectoryWatcher - -> MODIFY [/Users/fabian/tmp/asdf/src/ch/asdf/home.clj] (isDirectory: false)
[ForkJoinPool.commonPool-worker-1] DEBUG io.methvin.watcher.DirectoryWatcher - DirectoryWatcher got an exception while watching!
java.lang.IllegalArgumentException: No implementation of method: :inst-ms* of protocol: #'clojure.core/Inst found for class: clojure.lang.Symbol
at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:584)
at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:576)
at clojure.core$eval20850$fn__20851$G__20841__20856.invoke(core.clj:6831)
at clojure.core$inst_ms.invokeStatic(core.clj:6842)
at clojure.core$inst_ms.invoke(core.clj:6838)
at com.biffweb.impl.time$seconds_between.invokeStatic(time.clj:25)
at com.biffweb.impl.time$seconds_between.invoke(time.clj:24)
at com.biffweb.impl.time$elapsed_QMARK_.invokeStatic(time.clj:37)
at com.biffweb.impl.time$elapsed_QMARK_.invoke(time.clj:35)
at com.biffweb.impl.misc$use_beholder$fn__28631.invoke(misc.clj:29)
at nextjournal.beholder$fn$reify__26181.onEvent(beholder.clj:13)
at io.methvin.watcher.DirectoryWatcher.onEvent(DirectoryWatcher.java:402)
at io.methvin.watcher.DirectoryWatcher.runEventLoop(DirectoryWatcher.java:349)
at io.methvin.watcher.DirectoryWatcher.lambda$watchAsync$1(DirectoryWatcher.java:232)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
[ForkJoinPool.commonPool-worker-1] DEBUG io.methvin.watcher.DirectoryWatcher - ENTRY_MODIFY [/Users/fabian/tmp/asdf/src/ch/asdf/home.clj]
[qtp672232333-43] DEBUG org.eclipse.jetty.util.thread.ReservedThreadExecutor - ReservedThread@4147b149{RESERVED,thread=Thread[#43,qtp672232333-43,5,main]} task=null ReservedThreadExecutor@28abd6d7{reserved=1/5,pending=0}
[qtp672232333-43] DEBUG org.eclipse.jetty.util.thread.ReservedThreadExecutor - ReservedThread@4147b149{IDLE,thread=Thread[#43,qtp672232333-43,5,main]} exited ReservedThreadExecutor@28abd6d7{reserved=0/5,pending=0}
[qtp672232333-43] DEBUG org.eclipse.jetty.util.thread.QueuedThreadPool - ran ReservedThread@4147b149{IDLE,thread=null} in QueuedThreadPool[qtp672232333]@2811738d{STARTED,8<=8<=50,i=3,r=-1,q=0}[ReservedThreadExecutor@28abd6d7{reserved=0/5,pending=0}]
that is bizarre... this is the line that breaks: https://github.com/jacobobryant/biff/blob/93baa98ff714d2bc29715ab746f6aa7ce5751ec0/src/com/biffweb/impl/misc.clj#L29
the :now gets converted to (java.util.Date.). it appears that either that or #inst "1970"
is ending up as a symbol instead of an inst.
can you eval (inst-ms #inst "1970")
in the repl?
I wonder if you have something funky going on with data readers.
it also might not hurt to try another jdk version just in case? technically 19 is unsupported by clojure I believe since it's not an LTS release; you could try 17 or 21 instead... though ideally we can at least reproduce the symbol-instead-of-inst behavior without switching jdks.
; eval (root-form): (inst-ms #inst "1970")
; (err) Execution error (IllegalArgumentException) at repl/eval53833 (REPL:87).
; (err) No implementation of method: :inst-ms* of protocol: #'clojure.core/Inst found for class: clojure.lang.Symbol
the plot thickens! does switching jdks make a difference? what do you get from evaling (identity #inst "1970")
?
as a workaround it wouldn't hurt to use a modified version of use-beholder
that initializes last-called
to (java.util.Date.)
instead of #inst "1970"
. I'll make that change in the next release, and in the mean time you can copy-paste use-beholder
into your project and make the changes there. I'm interested to see if any other errors come up.
also you could try creating a miniminal example of the bug--E.g. create a new project with only nrepl as a dependency, start an nrepl server, see if you get the error. etc.
very interesting. I'll try to do some fiddling sometime too.
Same experience here, fresh starter project, - Arch Linux
$ clj --version
Clojure CLI version 1.11.2.1446
$ java --version
openjdk 22 2024-03-19
OpenJDK Runtime Environment (build 22+36)
OpenJDK 64-Bit Server VM (build 22+36, mixed mode, sharing)
Once I deleted ~/.m2
and restarted, reloading started working again.Nothing in ~/.clojure/deps.edn
except for a few aliases that I wasn't using. Just did clj -M:dev dev
are you able to reproduce the error after deleting .m2
?
maybe there's some set of libraries that conflict and cause the error some how... like two libraries with the same namespace or something?
if you do manage to get back in the broken state, do you get this behavior as well? https://clojurians.slack.com/archives/C013Y4VG20J/p1708722054768849?thread_ts=1708614733.658089&cid=C013Y4VG20J
Everything is well after removing ~/.m2. Should probably have saved the bad state somewhere.
Sounds good!
I wonder if there could be some problem on Mac? (I'm on Windows + WSL, so those two platforms are easy for me to test on, but Mac is a little less convenient.) Could someone else with a Mac try creating a new project (`clj -M -e '(load-string (slurp "https://biffweb.com/new.clj"))'`) and change some files and verify that the changes take effect without errors?