protorepl

2018-11-24T04:08:27.010Z

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?

2018-11-24T04:09:51.010500Z

All the project folders are in the class path

2018-11-24T04:13:28.011200Z

Using Atom on a windows 10 box

seancorfield 2018-11-24T04:33:34.011900Z

@pdmct Can you explain exactly what you did to lead you to believe the project namespaces are not available?

seancorfield 2018-11-24T04:34:15.012300Z

How did you start your REPL? How are you trying to find/load the namespaces?

2018-11-24T04:35:06.013Z

I am starting the repl from the project.clj using the protorepl menu item.

2018-11-24T04:37:52.015Z

when it loads the repl it complains about not being able to find any of the project namespaces list in my requires expressions

2018-11-24T04:39:21.016100Z

it prints that it is starting the repl in the base folder of the project, eg Starting repl in C:\projects\proj_api etc

2018-11-24T04:41:13.017600Z

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)

seancorfield 2018-11-24T04:42:25.018300Z

Ah, turn off the three "refresh" options in ProtoREPL. They are very problematic for most people.

seancorfield 2018-11-24T04:43:07.018900Z

Unless your project is set up correctly for the "Reloaded" lifecycle, those options will break your project.

2018-11-24T04:46:32.021200Z

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 ...

2018-11-24T04:47:32.021900Z

same Exception as above is again displayed in a error pop-up

seancorfield 2018-11-24T04:48:12.022300Z

If you turn those three options off, it shouldn't even try to do that.

2018-11-24T04:48:58.022400Z

These 3?

seancorfield 2018-11-24T04:50:44.023500Z

Yup, like this

2018-11-24T04:51:31.024400Z

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 😞

seancorfield 2018-11-24T04:51:59.024900Z

Hmm, I don't know what to suggest. With those option disabled, ProtoREPL won't try to reload anything.

2018-11-24T04:52:24.025200Z

Will it do it on startup of the repl?

seancorfield 2018-11-24T04:52:45.025700Z

No, the third option being disabled should stop that too.

2018-11-24T04:54:15.027200Z

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?

seancorfield 2018-11-24T04:54:52.027800Z

Yes. That should be exactly like running lein repl in that folder from the Command prompt.

seancorfield 2018-11-24T04:55:38.029100Z

Hmm, are you using WSL or the Windows CMD window?

2018-11-24T04:56:58.030Z

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

2018-11-24T04:57:33.030400Z

I also have WSL setup and it works fine too

seancorfield 2018-11-24T04:59:47.031600Z

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...

2018-11-24T05:01:00.032900Z

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

2018-11-24T05:02:45.033700Z

there is nothing in the dev console

2018-11-24T05:05:35.034600Z

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=>

seancorfield 2018-11-24T05:09:37.035700Z

That's strange... looks pretty messed up... I've never seen anything like that, even on Windows 😐

2018-11-24T05:12:13.036400Z

Anything in a $HOME/.lein/profiles.clj file or user.clj file that might be causing troubles?

2018-11-24T05:12:49.036800Z

Deleting or at least temporarily renaming such files, if they exist, may be a good experiment to try.

2018-11-24T05:14:40.038Z

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

2018-11-24T05:15:42.039Z

it still seems to be refreshing when I make any changes , even though the options are unchecked

2018-11-24T05:15:51.039300Z

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.

2018-11-24T05:18:04.040500Z

I do have a .lein folder so I assumed it is in there ... it does seem to notice when i change that file

2018-11-24T05:34:39.041400Z

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.

pez 2018-11-24T07:26:02.043100Z

Tried with a fresh project? (`lein new` I mean. )