conjure icon indicating copy to clipboard operation
conjure copied to clipboard

Randomly fails to find namespaces

Open geekingfrog opened this issue 2 years ago • 2 comments

I have some seemingly random errors when refreshing all namespaces. Conjure is connected to a repl alright, but when I attempt to refresh all namespaces with <localleader>ra I get some namespace xxx not found. However, if I open the offending file, and save it again (:w), go back to the main entrypoint, and <localleader>ra again, then it works. Usually I get other missing namespace errors, and opening up these files clears the problem.

The behavior is not consistent however, and once "fixed", I am unable to re-trigger the bug. If that's any help, I had these errors on the following simple toy repo: https://github.com/geekingfrog/aoc-2020 from the entry point src/aoc_2020/core.clj.

My global leiningen profile is as follow:

{:repl {:plugins [[cider/cider-nrepl "0.27.3"]
                  [mx.cider/enrich-classpath "1.9.0"]]
        :dependencies [[nrepl "0.9.0"]]}}

lein version:

Leiningen 2.9.8 on Java 1.8.0_332 OpenJDK 64-Bit Server VM

neovim version: 0.7.0

geekingfrog avatar May 10 '22 10:05 geekingfrog

This is also happenning for me randomly, OS and Neovim specs: https://github.com/Olical/conjure/issues/481#issue-1670748587

oryband avatar May 17 '23 13:05 oryband

So I see this too sometimes with some very specific namespaces and I reproduced it without Conjure in the way at all, just at the REPL. All Conjure does with the namespace reload tooling is invoke a single function based on which mapping you use, there's no special sauce here.

Issues like this smell of the same kind of thing to me: https://stackoverflow.com/questions/44246924/clojure-tools-namespace-refresh-fails-with-no-namespace-foo

Maaaaybe we can mitigate by having Conjure provide some specific helper arguments to the functions consistently. Like I saw someone mention that you can alter the target path for the reload function, so maybe Conjure can choose a name that won't conflict with other tooling 🤔

And here's the underlying tooling used here if people were not aware https://github.com/clojure/tools.namespace

Olical avatar May 21 '23 11:05 Olical