Fork me on GitHub
#calva
<
2023-01-20
>
Luke Johnson16:01:43

Hello! I occasionally have a weird issue where my repl will just lose references to eval’d namespaces/vars. I’ll get output like this:

; Evaluating file: my_file.clj
; Syntax error compiling at (my/project/directory/structure/my_file.clj:149:7).
; No such var: other-namespace/my-var
; Evaluation of file my_file.clj failed: class clojure.lang.Compiler$CompilerException
So I have to go through a chain of re-evaling namespaces, starting at the bottom until the namespace I am actually working in compiles. Restarting my REPL/Calva fixes this, but it’s randomly annoying. A coworker of mine https://github.com/BetterThanTomorrow/calva/issues/2025 where he suspects the problem originates. I’m posting it here to get some visibility and other possible ideas as to why this happens and how to resolve it.

skylize17:01:40

The problem you describe here sounds the same as https://clojurians.slack.com/archives/CBE668G4R/p1673429735658019 and the thread directly above your post https://clojurians.slack.com/archives/CBE668G4R/p1674113409966499. (No Issue filed yet, that I am aware of. So it would be helpful if you want to write one up.) The Issue you linked to describes difficulty with a custom Jack-in, which does not seem related.

Luke Johnson19:01:54

Thanks for the context. The issue I linked is possible adjacent since the afterCLJReplJackInCode in my project calls a start function that loads all the namespaces and dependencies.

pez21:01:58

I agree with @eveningsky that it sounds like an unlikely connection with that issue. I am known to be wrong often, so there could still be a connection. I have created two tiny projects in the Calva repo: 1. https://github.com/BetterThanTomorrow/calva/tree/dev/test-data/projects/load-bar-requiring-foo (failing to) reproduce the issue you report here, @james.luke.johnson 2. https://github.com/BetterThanTomorrow/calva/tree/dev/test-data/projects/repl-connected-code Reproducing the connect sequence bug your college reported. Please use the first project there to try find a reliable reproduction. I've also created an issue tracking this: https://github.com/BetterThanTomorrow/calva/issues/2026

pez21:01:58
replied to a thread:Hello! I occasionally have a weird issue where my repl will just lose references to eval’d namespaces/vars. I’ll get output like this: ; Evaluating file: my_file.clj ; Syntax error compiling at (my/project/directory/structure/my_file.clj:149:7). ; No such var: other-namespace/my-var ; Evaluation of file my_file.clj failed: class clojure.lang.Compiler$CompilerException So I have to go through a chain of re-evaling namespaces, starting at the bottom until the namespace I am actually working in compiles. Restarting my REPL/Calva fixes this, but it’s randomly annoying. A coworker of mine https://github.com/BetterThanTomorrow/calva/issues/2025 where he suspects the problem originates. I’m posting it here to get some visibility and other possible ideas as to why this happens and how to resolve it.

I agree with @eveningsky that it sounds like an unlikely connection with that issue. I am known to be wrong often, so there could still be a connection. I have created two tiny projects in the Calva repo: 1. https://github.com/BetterThanTomorrow/calva/tree/dev/test-data/projects/load-bar-requiring-foo (failing to) reproduce the issue you report here, @james.luke.johnson 2. https://github.com/BetterThanTomorrow/calva/tree/dev/test-data/projects/repl-connected-code Reproducing the connect sequence bug your college reported. Please use the first project there to try find a reliable reproduction. I've also created an issue tracking this: https://github.com/BetterThanTomorrow/calva/issues/2026