error-message-index
error-message-index copied to clipboard
Distinguish between errors that don't exist and those that don't yet have an entry
There's some error numbers that are generated by the compiler, but don't yet have an entry on the error message index.
When searching for these errors, nothing comes up. This makes me feel like I've copied over the message wrong.
It would be helpful if even if didn't have an entry that a placeholder one would turn up that could explain that it's a valid message but that no one has written up an entry yet and maybe suggesting to the user that it's something they could do.
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:
- Add comment to readme to start Calva with "deps.edn" and ":nextjournal/clerk"
- Make sure escaping of spaces in paths is handled consistently
- Ensure
(user/serve!)does keep the user stuck on the index page