Fork me on GitHub
#nrepl
<
2021-09-19
>
devurandom15:09:44

Hi! I am trying to connect to an nREPL service created by someone else's software (Witchcraft plugin for Minecraft / Spigot) with Cursive 1.11.0, but I get this output when connecting:

Connecting to remote nREPL server...
=> :clj
=> #'cursive.repl.runtime/print-last-error
=> nil
=> #'cursive.repl.runtime.class/class-defs
Clojure 1.10.3
=> nil
=>
"{:namespaces #{\"refactor-nrepl.inlined-deps.rewrite-clj.v0v6v1.rewrite-clj.custom-zipper.core\"
[...]
Something similar also happens when I enter commands into my REPL window. REPL-y on the other hand outputs:
REPL-y 0.5.1, nREPL 0.8.3
Clojure 1.10.3
OpenJDK 64-Bit Server VM 16.0.2+7
reply.eval-modes.nrepl=> WARNING: cat already refers to: #'clojure.core/cat in namespace: net.cgrand.parsley.fold, being replaced by: #'net.cgrand.parsley.fold/cat
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)

Error loading namespace; falling back to user

nil#object[clojure.lang.Namespace 0x3792b16b "user"]nil
That looks a bit more "normal". (Apart for the three strange outputs at the end.) Any idea what this is, or how to fix it?

greg14:09:12

The second screen looks like an error when loading user namespace. Regarding the first one, if you are sure you made all steps correctly, I would report an issue on github: https://github.com/lambdaisland/witchcraft-plugin

greg14:09:27

Quote from README: "Now you can connect with your nREPL-capable editor to port 25555 and start manipulating the game. If you get any errors at this stage please file https://github.com/lambdaisland/witchcraft-plugin/issues."

devurandom12:09:46

@U023TQF5FM3 Thanks! I also got some support from @U0567Q30W (author of Cursive) in https://clojurians.slack.com/archives/C0744GXCJ/p1632066950143600 and @U07FP7QJ0 (author of Witchcraft) in PMs. There are different hypothesis on what might cause this behaviour, one of which is that the message IDs of the nREPL responses might not match those of the requests. @U07FP7QJ0 created https://github.com/lambdaisland/nrepl-proxy to help debug this on an nREPL message level. I will have a deeper look at the problem later this week. 🙂

👍 2
plexus05:09:37

Thanks for the help @U023TQF5FM3, we may have found a probable cause, I've put out a fix.

greg23:09:34

You have done all the heavy lifting @U07FP7QJ0 @U0567Q30W @U368JQA01 👏👏👏