andycraig
andycraig

Reputation: 870

Can't switch to repl in spacemacs cider (Clojure)

In spacemacs, I am able to start a cider repl with cider-jack-in: it says 'Connected.' followed by a quote, as expected. But then cider-switch-to-repl-buffer does not open a repl buffer, and just produces the following message:

Invalid function: (repl (or the-repl a-repl))

Googling 'cider "invalid function repl"' produces only a cider issue relating to nim-mode (https://github.com/clojure-emacs/cider/issues/1712), which is not one of the configuration layers I have installed.

I am able to run the repl from the terminal using lein repl without issue.

Upvotes: 0

Views: 559

Answers (1)

andycraig
andycraig

Reputation: 870

I came across the following 'solution' while trying to debug this issue. I have no idea why it works and it's not very satisfying, but it does seem to resolve the problem.

  1. In spacemacs, activate debug mode with SPC t D
  2. Try to switch to repl buffer with SPC m s s
  3. In the debug frame, hit ENTER over (repl (or the-repl a-repl)) to open cider-mode.el.
  4. Make any edit to cider-mode.el and save.
  5. Undo the edit just made and save.
  6. Restart spacemacs.

After doing this, SPC m ' (cider-jack-in) followed by SPC m s s (cider-switch-to-repl-buffer) opens the repl buffer as desired.

Upvotes: 0

Related Questions