Fork me on GitHub
#spacemacs
<
2019-04-29
>
spfeiffer07:04:59

I am on develop, updated all packages: When I cider-jack-in, nREPL 0.21something gets started, and the REPL window rightfully complains that i should use 0.4.4+. I found a troubleshooting info in the nREPL repo that i need to set the nREPL dependency explicitly in ~/.lein/profiles.clj under the :repl key. I did that, now the lein command line i see in the minibuffer when doing the jack-in says something about nREPL 0.6.0, but still the 0.21something gets loaded. When i do a „lein repl" on the comman line, the 0.6 version gets loaded as expected. Any ideas?

jahson07:04:12

Is there any nrepl in your project.clj?

spfeiffer12:04:18

No, absolutely not. Sorry for not stating that explicitly.

spfeiffer12:04:24

I have a untouched project.clj from a lein new app test-app

spfeiffer12:04:02

I just retested on my work windows machine, had an older version of develop there. lein command line in the minibuffer says its injecting nrepl 0.4.5 and cider-nrepl 0.19-SNAPHOT. Output in repl window says correct cider-nrepl version, but nrepl 0.2.12. I then pulled newest develop, updated all packages, did cider-jack-in again. Now commandline said nrepl 0.6.0 and cider-nrepl 0.22, but repl window still says nrepl 0.2.12, while cider-nrepl is 0.22. Obviously the nrepl dependency does not get updated correctly through command line?

spfeiffer12:04:41

But injecting cider-nrepl dependency works fine.

spfeiffer13:04:31

Looking closely, even lein repl on the command line does not pick up an explicit nrepl dependency from profiles.clj

spfeiffer13:04:11

So the root cause seems to bei lein, not cider or spacemacs.

spfeiffer13:04:50

Ah, i got it. Lein 2.8.1 is too old and is referencing org.clojure/tools.nrepl instead of nrepl/nrepl. So dynamically merging the nrepl/nrepl dependency has no effect, it still loads org.clojure/tools.nrepl.

spfeiffer14:04:00

NOW i found the hint in the nREPL docs that lein 2.9.0 minimum is needed… sigh

👍 4
practicalli-johnny15:04:46

@spfeiffer the minimum version of Leiningen is stated in the develop branch of the Spacemacs Clojure layer docs. However, its only in the manual connection section, so not very obvious. Would having a pre-requisites (Java, Leiningen, Boot, clj versions) at the start the the Clojure layer documentation help?

spfeiffer15:04:25

TBH, not really. It would help if cider-nrepl would not only warn me about the outdated nrepl dep, but also outdated lein.

spfeiffer15:04:50

That should be easy…so its not a spacemacs issue

practicalli-johnny17:04:57

Yes, reporting minimum Leiningen version sounds a good idea. Are you going to raise a ticket or PR with the CIDER project to see if they will add this?

spfeiffer19:04:58

I cannot do a PR, no knowledge of elisp. I could do the issue, though.

mathpunk15:04:52

Has anyone experience a thing where, your spacemacs preferences must be manually loaded (`SPC f e R`) any time you start emacs?

mathpunk15:04:13

There aren't any errors through or tests failed on startup, but I have to do that every time

practicalli-johnny17:04:49

@mathpunk nope. when ever I had things fail to load its either been a typo or error in .spacemacs file or a bug in a package. You could also just do SPC f e D and see if there are any significant changes between the version of Spacemacs you are running and the default .spacemacs-template Otherwise I suggest moving your .spacemacs file out of the way, restart Spacemacs (which creates a new .spacemacs file) and see if you get the same issue. Then just use ediff to add back your customisations into the new .spacemacs file and restart to see which of them causes the problem. If you are using any elisp code, you can away try evaluate it, , e e, when you have the .spacemacs file open to see if that code generates an error.

scknkkrer17:04:09

I can’t start repl from Spacemacs.

ag19:04:43

“I just purchased a new car, but it won’t start”. please give us some more info, what’s happening, what do you see in Messages buffer? Does nrepl buffer appear at all, what’s in there? Help us a bit so we can help you

scknkkrer17:04:52

I have just cleaned everything and install everything from the beginning.

scknkkrer17:04:11

Latest version Leiningen, Emacs, Spacemacs, Init project of a Re-Natal, MacOSX Mojave.

spfeiffer20:04:49

Again: What did you do, what did you expect to happen, what happened instead?

spfeiffer20:04:11

What made you think that the repl didn't start?

spfeiffer20:04:15

What was relevant output in the minibuffer, the message buffer and the repl buffer (if it exists)?

scknkkrer20:04:15

I have created a re-natal project with re-natal version 10.0.0.

scknkkrer20:04:28

I want to run this project with spacemacs.

scknkkrer20:04:34

Latest versions of everything.

scknkkrer20:04:40

clean install.

scknkkrer20:04:05

emacs, leiningen, spacemacs, .spacemacs file is new also!

scknkkrer20:04:46

I have to implement a prototype until tomorrow. This seems like a joke.

scknkkrer20:04:13

Spacemacs hangs when I cider-jack-in to the project.

ag20:04:30

@scknkkrer it seems you’re frustrated to the point that you are not paying attention to what we are trying to tell you. We got it - you have a clean install of everything. But we need to know more in order to help you. Establishing repl connection in a clojurescript project requires a few things, it’s not some kinda of magic “that just works right off the bat”. https://lambdaisland.com/guides/clojure-repls

scknkkrer21:04:19

Sorry, I have spend a whole day to figure out this like a monkey. You are right. Is there any trigger to give me a stacktrace or something to me ?

scknkkrer21:04:09

#### System Info 💻 - OS: darwin - Emacs: 26.2 - Spacemacs: 0.200.13 - Spacemacs branch: master (rev. c7a103a77) - Graphic display: nil - Distribution: spacemacs - Editing style: vim - Completion: helm - Layers: ‘’‘elisp (vimscript sql d php yaml typescript java javascript (indium :fetcher github :repo “NicolasPetton/Indium” :old-names (jade)) fsharp octave nginx (c-c++ :variables c-c++-enable-clang-support t c-c++-default-mode-for-headers ’c++-mode) ruby (clojure :variables clojure-enable-fancify-symbols t clojure-enable-clj-refactor t) (markdown :variables markdown-live-preview-engine ’vmd) haskell helm auto-completion exercism-layer html emacs-lisp git markdown org (shell :variables shell-default-height 30 shell-default-term-shell “/bin/zsh” shell-default-position ‘bottom) spell-checking syntax-checking version-control) ‘’‘ - System configuration features: JPEG RSVG IMAGEMAGICK GLIB NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS LCMS2

scknkkrer21:04:29

@U0G75ARHC this is my info. I will bring another informations.

ag21:04:35

First try from the terminal. Does it work there? Then try connecting to the repl from Emacs. cider-connect, still works? Then do cider-jack-in, check nrepl buffer, check Messages buffer

scknkkrer21:04:50

Yes, but a few changes required. Cider.piggieback must be updated. I have done it, and then, yes, leiningen runs repl from command-line. And this works really great.

ag21:04:03

have you checked your local ~/.lein/profiles.clj

ag21:04:28

maybe there’s an old artifact or something

scknkkrer21:04:03

Yes, there is no profiles file on my mac. I have never needed.

scknkkrer21:04:17

I have just removed all repositories.

scknkkrer21:04:21

And tried again.

scknkkrer21:04:25

Nothing has changed.

ag21:04:04

remove piggieback from project.clj

scknkkrer21:04:11

I was trying to debug trace to the problem. But, toggling debug on error is not working either. When I try to Jack-in cider. It’s just hanging.

ag21:04:38

actually can you post your project.clj?

scknkkrer21:04:39

My project.clj file.

scknkkrer21:04:27

I have just removed the piggieback from my project. But it still doesn’t work.

scknkkrer21:04:02

When I try to delete .spacemacs file and reinstall clojure-layer.

scknkkrer21:04:11

It says like that after installing the layer.

scknkkrer21:04:15

File mode specification error: (file-mission Cannot open load file No such file or directory cider-eval-sexp-fu)

ag21:04:29

remove this as well: {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}

scknkkrer21:04:55

I have done it.

ag21:04:44

figwheel-sidecar is outdated

scknkkrer21:04:07

I have tried with 5.18 also.

ag21:04:37

lein-cljsbuild is outdated too

ag21:04:17

[org.clojure/clojurescript “1.10.520”]

scknkkrer21:04:54

[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-SNAPSHOT\"\] -- repl :headless :host localhost...

scknkkrer21:04:30

Show: Project-Only All 
  Hide: Clojure Java REPL Tooling Duplicates  (10 frames hidden)

1. Unhandled java.lang.Exception
   Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to
   load piggieback. This is commonly caused by A) not providing piggieback as a
   dependency and/or B) not adding piggieback middleware into your nrepl
   middleware chain.
   
   example profile.clj code: ----- :profiles {:dev {:dependencies
   [[cider/piggieback <current-version>] [org.clojure/tools.nrepl
   <current-version>]] :repl-options {:nrepl-middleware
   [cider.piggieback/wrap-cljs-repl]}}} ----- Please see the documentation for
   piggieback here 
   
   Note: Cider will inject this config into your project.clj. This can cause
   confusion when your are not using Cider.

scknkkrer21:04:36

repl.clj:  182  figwheel-sidecar.repl/eval19040/fn
              MultiFn.java:  233  clojure.lang.MultiFn/invoke
                  repl.clj:  346  figwheel-sidecar.repl/repl
                  repl.clj:  344  figwheel-sidecar.repl/repl
               RestFn.java:  436  clojure.lang.RestFn/invoke
                system.clj:  525  figwheel-sidecar.system/start-figwheel-repl
                system.clj:  516  figwheel-sidecar.system/start-figwheel-repl
                system.clj:  589  figwheel-sidecar.system/figwheel-cljs-repl*
                system.clj:  587  figwheel-sidecar.system/figwheel-cljs-repl*
                system.clj:  610  figwheel-sidecar.system/cljs-repl*
                system.clj:  602  figwheel-sidecar.system/cljs-repl*
                system.clj:  636  figwheel-sidecar.system/start-repl
                system.clj:  630  figwheel-sidecar.system/start-repl
                system.clj:  634  figwheel-sidecar.system/start-repl
                system.clj:  630  figwheel-sidecar.system/start-repl
                  AFn.java:  160  clojure.lang.AFn/applyToHelper
                  AFn.java:  144  clojure.lang.AFn/applyTo
                  core.clj:  659  clojure.core/apply
                  core.clj:  652  clojure.core/apply
                system.clj:  644  figwheel-sidecar.system/cljs-repl
                system.clj:  642  figwheel-sidecar.system/cljs-repl
               RestFn.java:  421  clojure.lang.RestFn/invoke
              repl_api.clj:  114  figwheel-sidecar.repl-api/cljs-repl
              repl_api.clj:  107  figwheel-sidecar.repl-api/cljs-repl
              repl_api.clj:  111  figwheel-sidecar.repl-api/cljs-repl
              repl_api.clj:  107  figwheel-sidecar.repl-api/cljs-repl
                  user.clj:   21  user/start-figwheel
                  user.clj:   15  user/start-figwheel
               RestFn.java:  408  clojure.lang.RestFn/invoke
                      REPL:   43  user/eval32619
                      REPL:   43  user/eval32619
             Compiler.java: 7062  clojure.lang.Compiler/eval
             Compiler.java: 7025  clojure.lang.Compiler/eval
                  core.clj: 3206  clojure.core/eval
                  core.clj: 3202  clojure.core/eval
                  main.clj:  243  clojure.main/repl/read-eval-print/fn
                  main.clj:  243  clojure.main/repl/read-eval-print
                  main.clj:  261  clojure.main/repl/fn
                  main.clj:  261  clojure.main/repl
                  main.clj:  177  clojure.main/repl
               RestFn.java:  137  clojure.lang.RestFn/applyTo
                  core.clj:  657  clojure.core/apply
                  core.clj:  652  clojure.core/apply
                regrow.clj:   18  refactor-nrepl.ns.slam.hound.regrow/wrap-clojure-repl/fn
               RestFn.java: 1523  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   79  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:   55  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:  142  nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
                  AFn.java:   22  clojure.lang.AFn/run
               session.clj:  171  nrepl.middleware.session/session-exec/main-loop/fn
               session.clj:  170  nrepl.middleware.session/session-exec/main-loop
                  AFn.java:   22  clojure.lang.AFn/run
               Thread.java:  748  java.lang.Thread/run

scknkkrer21:04:51

Not it needs piggieback.

scknkkrer21:04:57

I will give it.

ag21:04:18

what’s your cider-version?

ag21:04:26

can you run M-x cider-version?

scknkkrer21:04:06

CIDER 0.22.0snapshot (package: 20190419.1025)

scknkkrer21:04:22

@U0G75ARHC thank you. My Spacemacs’ repl is working now. I should have check twice the versions. If you have come to Turkey one day, just let me know. Thanks again.

ag21:04:40

no problem. I’m glad you have sorted it out