Fork me on GitHub
#protorepl
<
2018-11-24
>
pdmct04:11:27

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?

pdmct04:11:51

All the project folders are in the class path

pdmct04:11:28

Using Atom on a windows 10 box

seancorfield04:11:34

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

seancorfield04:11:15

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

pdmct04:11:06

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

pdmct04:11:52

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

pdmct04:11:21

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

pdmct04:11:13

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)

seancorfield04:11:25

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

seancorfield04:11:07

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

pdmct04:11:32

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

pdmct04:11:32

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

seancorfield04:11:12

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

seancorfield04:11:44

Yup, like this

pdmct04:11:31

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 😞

seancorfield04:11:59

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

pdmct04:11:24

Will it do it on startup of the repl?

seancorfield04:11:45

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

pdmct04:11:15

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?

seancorfield04:11:52

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

seancorfield04:11:38

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

pdmct04:11:58

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

pdmct04:11:33

I also have WSL setup and it works fine too

seancorfield04:11:47

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

pdmct05:11:00

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

pdmct05:11:45

there is nothing in the dev console

pdmct05:11:35

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

seancorfield05:11:37

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

andy.fingerhut05:11:13

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

andy.fingerhut05:11:49

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

pdmct05:11:40

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

pdmct05:11:42

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

andy.fingerhut05:11:51

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.

pdmct05:11:04

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

andy.fingerhut05:11:39

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.

pez07:11:02

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