I am trying to setup protorepl but am struggling with getting the project namespaces to load. Using lein/project.clj which works fine from commandline .. but protorepl can't find any of the project namespaces. How can I confirm the config is correct?
All the project folders are in the class path
Using Atom on a windows 10 box
@pdmct Can you explain exactly what you did to lead you to believe the project namespaces are not available?
How did you start your REPL? How are you trying to find/load the namespaces?
I am starting the repl from the project.clj using the protorepl menu item.
when it loads the repl it complains about not being able to find any of the project namespaces list in my requires expressions
it prints that it is starting the repl in the base folder of the project, eg Starting repl in C:\projects\proj_api
etc
after the repl has starts and Refreshing code...
I get:
java.lang.Exception: namespace 'proj-api.auth' not found, compiling:(proj_api/mymodule.clj:1:1)
Ah, turn off the three "refresh" options in ProtoREPL. They are very problematic for most people.
Unless your project is set up correctly for the "Reloaded" lifecycle, those options will break your project.
ok, I did that .. still get the same problem (the refreshing code part is not printed now) I see
:reloading (...list of namespaces)
:error-while-loading proj-api.mymodule
then
Error refreshing. CAUSE: namespace 'proj-api.auth' not found
#error {
:cause "namespace 'proj-api.auth' not found"
:via
[{:type clojure.lang.Compiler$CompilerException ...
same Exception as above is again displayed in a error pop-up
If you turn those three options off, it shouldn't even try to do that.
These 3?
Yup, like this
Yes, that is what I did. I also did a restart of Atom and still get the reloading
message and the Error refreshing. CAUSE...
as above 😞
Hmm, I don't know what to suggest. With those option disabled, ProtoREPL won't try to reload anything.
Will it do it on startup of the repl?
No, the third option being disabled should stop that too.
It no longer seems to 'Refresh' but it does reload
or maybe load
for the first time -- I am starting it from my project.clj
so i expect it should try to start in the project namespace right?
Yes. That should be exactly like running lein repl
in that folder from the Command prompt.
Hmm, are you using WSL or the Windows CMD window?
When I run lein repl
from the commandline it drops me into the project namespace with no problems, which is why I suspect some path issue or something ... I am using CMD
I also have WSL setup and it works fine too
Weird. Something is clearly trying to run a namespace reload when it starts the REPL in Atom -- and that's what is breaking things. If those options are disabled, I don't know why it would still be trying to reload things...
is there some way I can see some debug logging or something ... I was trying to get this going on a different Win10 box yesterday and had exactly the same issue
there is nothing in the dev console
I haven't played with nrepl much but when I try to connect to it from lein I get the following:
^Cpeter@DESKTOP-OAVTGKG:/mnt/c/Users/peter/Documents/Projects/proj-api$ lein repl :cnect 127.0.0.1:60194
Connecting to nREPL at 127.0.0.1:60194
CompilerException java.lang.RuntimeException: Unable to resolve symbol: *print-length* in this context, compiling:(C:\Users\peter\AppData\Local\Temp\form-init2542206326874134424.clj:1:90)
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.9.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_181-b13
CompilerException java.lang.RuntimeException: Unable to resolve symbol: intern in this context, compiling:(C:\Users\peter\AppData\Local\Temp\form-init2542206326874134424.clj:1:715)
#object[clojure.lang.Namespace 0x479e8e0a "user"]
Error loading namespace; falling back to user
nil
user=>
That's strange... looks pretty messed up... I've never seen anything like that, even on Windows 😐
Anything in a $HOME/.lein/profiles.clj file or user.clj file that might be causing troubles?
Deleting or at least temporarily renaming such files, if they exist, may be a good experiment to try.
yes, no idea what I have done to break it ... I did add a dependency to profile.clj but that didn't seem to make any difference
it still seems to be refreshing when I make any changes , even though the options are unchecked
I don't know exactly how Windows Leiningen determines where to put what would be $HOME/.lein/profiles.clj so treat that name as an analogy.
I do have a .lein folder so I assumed it is in there ... it does seem to notice when i change that file
plugins and basically anything in that file can in some cases interfere with things. Temporarily renaming that file and trying lein
commands again can sometimes produce better (or at least different) results.
Tried with a fresh project? (`lein new` I mean. )