Open fbreuer opened 1 year ago
Note the problem is different if I jack in using other options. So first would be good to clarify which project type and alias I should choose.
Ok, the solution is to select type = deps.edn and alias :nextjournal/clerk and not :repl.
This gets me to a functioning repl. Doing (user/serve!)
from there leads to a long build process that then ends here:
; [:mentat.clerk-utils.build.shadow/clerk] Build completed. (1319 files, 1317 compiled, 0 warnings, 229.64s)
;
; Execution error (NoSuchFileException) at sun.nio.fs.UnixException/translateToIOException (UnixException.java:92).
; /Users/felix/Dropbox/Dev/Macro/macro-notes/2023-05-19%20Sam%20Ritchie/road-to-reality/src/reality/viewer.clj
with stacktrace
sun.nio.fs.UnixException/translateToIOException (UnixException.java:92)
sun.nio.fs.UnixException/rethrowAsIOException (UnixException.java:106)
sun.nio.fs.UnixFileSystemProvider/newByteChannel (UnixFileSystemProvider.java:218)
java.nio.file.Files/newByteChannel (Files.java:380)
java.nio.file.Files/readAllBytes (Files.java:3287)
babashka.fs/read-all-bytes (fs.cljc:612)
babashka.fs/read-all-bytes (fs.cljc:609)
nextjournal.clerk.analyzer/analyze-file (analyzer.clj:371)
nextjournal.clerk.analyzer/analyze-file (analyzer.clj:369)
nextjournal.clerk.analyzer/build-graph (analyzer.clj:540)
clojure.core.protocols/iter-reduce (protocols.clj:49)
clojure.core.protocols/fn (protocols.clj:75)
clojure.core.protocols/fn (protocols.clj:13)
clojure.core/reduce (core.clj:6886)
clojure.core/reduce (core.clj:6868)
nextjournal.clerk.analyzer/build-graph (analyzer.clj:534)
nextjournal.clerk.analyzer/build-graph (analyzer.clj:517)
nextjournal.clerk.eval/+eval-results (eval.clj:245)
nextjournal.clerk.eval/+eval-results (eval.clj:241)
nextjournal.clerk/show! (clerk.clj:58)
nextjournal.clerk/show! (clerk.clj:22)
mentat.clerk-utils.build/serve! (build.clj:77)
mentat.clerk-utils.build/serve! (build.clj:49)
user/serve! (user.clj:61)
user/serve! (user.clj:54)
user/serve! (user.clj:59)
user/serve! (user.clj:54)
user/eval62427 (NO_SOURCE_FILE:29)
clojure.lang.Compiler/eval (Compiler.java:7194)
clojure.core/eval (core.clj:3215)
clojure.core/eval (core.clj:3211)
nrepl.middleware.interruptible-eval/evaluate (interruptible_eval.clj:87)
clojure.core/apply (core.clj:667)
clojure.core/with-bindings* (core.clj:1990)
nrepl.middleware.interruptible-eval/evaluate (interruptible_eval.clj:87)
clojure.main/repl (main.clj:437)
clojure.main/repl (main.clj:458)
clojure.main/repl (main.clj:368)
nrepl.middleware.interruptible-eval/evaluate (interruptible_eval.clj:84)
nrepl.middleware.interruptible-eval/evaluate (interruptible_eval.clj:56)
nrepl.middleware.interruptible-eval/interruptible-eval (interruptible_eval.clj:152)
nrepl.middleware.session/session-exec (session.clj:218)
nrepl.middleware.session/session-exec (session.clj:217)
java.lang.Thread/run (Thread.java:1589)
I should add that the file it is complaining about is in fact present.
Ok I figured it out. The issue is with spaces in the path. Somewhere along the above stack trace spaces get escaped " " -> "%20", but babashka.fs does not handle %20 as a space. Probably an easy fix if one knows where to look in this very deep stack trace.
There was one more issue. For some reason when using (user/serve!)
I would always see the index page and never the introduction, no matter whether I was navigating to localhost:7777
or localhost:7777/essays/reality/introduction
or variations thereof. I don't think this had anything to do with spaces in paths, as this occurred after I had moved the repo to a different location without spaces in paths.
Workaround has been to instead start clerk with (user/serve! {:index "essays/reality/introduction.md"})
so that I see the first essay on the index.
In summary, all problems figured-out on my end, but the following three follow-ups may be useful:
(user/serve!)
does keep the user stuck on the index page
I tried starting a REPL via Calva. I run the jack-in command and chose "deps.edn" as project type and "repl" as alias. (These may well not be the right choices.) I then got the following exception (after lots of apparently successful downloads). (I also ran
bb tasks
beforehand):