Fork me on GitHub
#cider
<
2019-01-26
>
syver14:01:42

Hey! New to clojure, and just installed CIDER, but I'm facing an issue. Every time I try to evaluate a function in my file, after M-x cider-jack-in, it returns fine if the function returns a value, but if it returns nil, i get the following error: error in process filter: eval: Wrong type argument: characterp, nil, and the REPL takes a few seconds to print the result, then hangs. I'm running Emacs 26.1 on Win10 using the newest version of CIDER from melpa. I saw someone else with the same problem on reddit (https://www.reddit.com/r/emacs/comments/9kii09/cider_any_prompt_that_returns_nil_yields_error_in/) but couldn't find any followup in GitHub, so I wanted to post here before posting a new GitHub issue, in case it's an already solved problem.

dpsutton14:01:06

that post mentions that sayed might be an issue. Are you running any plugins? Is this in spacemacs which brings a few more of the ancillary CIDER projects?

dpsutton14:01:53

i'm up to date with master and can't reproduce. but happy to walk through it with you

syver14:01:53

No this is my own Emacs config, not many other plugins installed (except clj-refactor and smartparens)

dpsutton14:01:15

and any trivial project, anything returning nil triggers this? nothing special?

dpsutton14:01:24

(and clj-refactor is up to date)?

syver14:01:58

I have attempted deleting my elpa folder multiple times, so should have the newest version of all plugins

dpsutton14:01:43

ok. and in your project file (project.clj or deps.edn) are you specifying versions of cider nrepl and refactor-nrepl or letting CIDER inject those for you?

syver14:01:41

CIDER injects them, the only dependency is clojure 1.9.0

syver14:01:20

the error also happens when actually typing out a command in the CIDER repl, for instance (println "Hello")

dpsutton14:01:28

ok. can we try this without cider refactor then?

dpsutton14:01:53

see if we can isolate the layer causing the problem. I suspect it is there since i can't reproduce

syver14:01:47

let's see. I do that by just removing clj-refactor as an emacs package, I guess?

dpsutton14:01:01

yes. that should be it. i vaguely remember it having some kind of sticky setting somewhere but its been a while since i've used it

syver14:01:37

alright, I removed clj-refactor (had to delete the package folder manually to make the nREPL not add nREPL-refactor as a plugin. the first eval works fine, but the same issue happens on subsequent evaluations.

dpsutton14:01:33

how versed in emacs are you? could you set the debugger to begin on errors and find your way through stack traces?

dpsutton14:01:38

i wish i could replicate

syver14:01:08

I'll try enabling the debugger!

dpsutton14:01:28

toggle-debugger-on-error should be what we want

syver14:01:59

That pointed me to pretty-mode! disabling it seemed to work. I think pretty mode wanted to redraw nil to some other symbol, which caused the system to hang

dpsutton14:01:26

Ah! No idea what that is but it sounds bad.

syver14:01:34

By the way, thanks for a very patient and thorough guide through the issue! Makes me feel very welcome into the community.

dpsutton14:01:52

Glad to have you

syver14:01:13

pretty-mode redraws certain symbols to their mathematical equivalents. lambda to λ etc

syver14:01:04

it's just vanity to have it enabled, so I have no problems turning it off for working with clojure 🙂

dpsutton15:01:01

ah i see. i normally don't like those because copy and paste and alignment get weird

dpsutton15:01:09

but for sure they look good in screen shots and on twitter

dpsutton15:01:14

same thing with ligatures

TobiH20:01:35

Hi there. Could someone help me with getting cider to work with clojurescript and figwheel? I cannot seem to get it working properly.

TobiH20:01:25

My problem in cider is that I can get cider to start an nrepl, but if I use figwheel as repl type it open the website, but then I have a prompt saying "STDIN:" in the minibuffer at the bottom. Inside that minibuffer I can interact with the clojurescript repl but I can't send any sexp from my core.cljs buffer in emacs to the figwheel repl.

TobiH20:01:38

And if I use the newer figwheel-main repl type (and a project created with lein new figwheel-main) cider still opens up the website and tries to create a figwheel repl, but the last thing printed in the cider-repl is "Opening URL http://localhost:9500" and after that nothing happens.

TobiH20:01:50

Also cider is always showing "not connected" in my modeline in emacs.