It seems I stumbled upon a bug: when using babashka as an nrepl server, printing something will correctly send the output to the nrepl client, however printing something inside something lazy-evaluated will instead send the result to babashka process itself:
fixed on master
thanks for reporting
Great, thanks!
I created an issue in babashka/nrepl
I’m running into a strange issue where a var can’t be found in a required namespace but when running that namespace directly, things are fine:
bb -cp bb-src -m mkl.atom
clojure.lang.ExceptionInfo: Could not resolve symbol: posts/sort-posts [at /Users/martinklepsch/code/03-personal/martinklepsch.org/bb-src/mkl/view.clj, line 197, column 16]
bb -cp bb-src -m mkl.view
; => works fine
note how the error occurs in view.clj
but then running mkl.view
is doing just fine
can I test this locally somehow?
yes, I can push it
https://github.com/martinklepsch/martinklepsch.org/tree/bootleg
hmm, if I add a (prn (resolve 'mkl.posts/sort-posts))
in the mkl.view namespace then I get nil when invoking that through -m mkl.atom :/
and when I put a side effect in the mkl.posts
ns I don't see it, so it seems it's not getting loaded somehow
yeah that matches what I’ve seen. I’ve observed something similar when loading these namespaces through the REPL as well but initially discarded it as flakyness in one of the intermediate layers
I'll take a deeper looking after the meeting I'm having
cool, no rush. Interestingly when deleting the :require mkl.view
from the mkl.atom
namespace it still fails with the same error
@martinklepsch I think I found it. I think you have a circular reference
mkv.view requires mkv.posts and vice versa
of course sci could give a better error here
ahh!
Removing [mkl.view]
from mkl.posts did the trick
Thanks for sponsoring :)