Fork me on GitHub
#cider
<
2019-09-03
>
sofra00:09:11

Anyone else had problems with emacs crashing when loading a user.clj file? this is an old project other newer projects work but this one is giving me problems

dpsutton00:09:49

Do y’all have a minimal repro? Is it just the presence of a user.clj?

sofra00:09:26

I don’t have a minimal repro yet, sorry. Still investigating. If I have an empty user.clj file it works, it is when I have some requires that it fails.

sofra01:09:20

I have narrowed it down to a particular namespace that is being required, it is a namespace internal to the app so I am guessing it is something weird we are doing

sofra01:09:36

In my case the issue of emacs crashing when loading user.clj came down to it requiring [clojure.tools.nrepl.server :as nrepl] from [org.clojure/tools.nrepl "0.2.13"]

dpsutton02:09:34

what was the last version of CIDER you were on? CIDER switched to nrepl/nrepl a while back and now org.clojure/tools.nrepl is not supported

sofra03:09:57

yep, switching it for nrepl/nrepl works. I am on CIDER 0.21.0snapshot

bozhidar11:09:48

> Is this one named Sao Paolo? Didn’t see a name attached

bozhidar11:09:51

Yeah, it is.

😎 4
lepistane15:09:24

is there a shortcut for cider-repl-clear-buffer ? From what i gather online it used to be but not anymore in docs i only found C-c C-o which clears only last result and i need whole repl cleaned

jumar17:09:52

If by chance you use spacemacs, there's also , s c

dpsutton15:09:32

ERROR: Unhandled REPL handler exception processing message {:op complete, :ns aclaimant.dashboard-v2.controls, :symbol log/spy, :context :same, :session 85879d90-112a-4993-bde8-57d97808a0bf, :id 38}
java.lang.AssertionError: Assert failed: file:/Users/dan/projects/aclaimant/acl/resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v6/suitable/js_introspection.cljs does not provide a namespace
still having issues with clj-suitable on 22.1

dpsutton15:09:42

prints a big stack trace into the repl

johanatan15:09:02

does anybody recognize the following stack trace?:

Exception in thread "main" java.lang.IllegalArgumentException: no conversion to symbol
	at clojure.core$symbol.invokeStatic(core.clj:596)
	at clojure.core$symbol.invoke(core.clj:589)
	at clojure.core$map$fn__5847$fn__5848.invoke(core.clj:2742)
	at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
	at clojure.core$transduce.invokeStatic(core.clj:6883)
	at clojure.core$into.invokeStatic(core.clj:6899)
	at clojure.core$into.invoke(core.clj:6887)
	at nrepl.cmdline$__GT_mw_list.invokeStatic(cmdline.clj:217)
	at nrepl.cmdline$__GT_mw_list.invoke(cmdline.clj:215)
	at nrepl.cmdline$build_handler.invokeStatic(cmdline.clj:226)
	at nrepl.cmdline$build_handler.invoke(cmdline.clj:219)
	at nrepl.cmdline$options__GT_handler.invokeStatic(cmdline.clj:295)
	at nrepl.cmdline$options__GT_handler.invoke(cmdline.clj:286)
	at nrepl.cmdline$server_opts.invokeStatic(cmdline.clj:343)
	at nrepl.cmdline$server_opts.invoke(cmdline.clj:331)
	at nrepl.cmdline$dispatch_commands.invokeStatic(cmdline.clj:432)
	at nrepl.cmdline$dispatch_commands.invoke(cmdline.clj:425)
	at nrepl.cmdline$_main.invokeStatic(cmdline.clj:448)
	at nrepl.cmdline$_main.doInvoke(cmdline.clj:443)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.core$apply.invokeStatic(core.clj:665)
	at clojure.main$main_opt.invokeStatic(main.clj:491)
	at clojure.main$main_opt.invoke(main.clj:487)
	at clojure.main$main.invokeStatic(main.clj:598)
	at clojure.main$main.doInvoke(main.clj:561)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.main.main(main.java:37)

johanatan15:09:11

^^ i get this when trying to jack-in-cljs

bozhidar15:09:23

@johanatan Seems you like you’re passing some bad arguments to clj when starting the nREPL server.

johanatan15:09:18

here are the arguments:

[nREPL] Starting server via clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/piggieback {:mvn/version "0.4.1"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.22.1"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'

dpsutton16:09:12

if you run that from the command line do you see the same behavior? perhaps more information?

dpsutton16:09:54

also, if you use a prefix while jacking in (`C-u C-c M-J` (capital J for clojurescript here) and edit the nrepl version to 21.1 do you see the same behavior?

johanatan16:09:26

Will try when I return. Thx!

johanatan16:09:37

It works when I copy/paste that into a terminal on the machine.

johanatan16:09:54

One more detail is that the CIDER attempt from Spacemacs is over a TRAMP connection.

johanatan16:09:48

After trying 21.1 i got a warning that i might want to try setting nrepl-use-ssh-fallback-for-remote-hosts. trying that now

johanatan16:09:45

That worked.

johanatan16:09:54

Seems to be an issue with 22.1 and TRAMP/remote shells.

johanatan17:09:29

although i do get this warning: "WARNING: CIDER 0.22.0 requires cider-nrepl 0.22.1, but you're currently using cider-nrepl 0.21.1. The version mismatch might break some functionality!"

dpsutton17:09:58

if you have that value set can you get it to work with 22.1? Is this a regression in functionality or regression in errors/info

johanatan17:09:27

i just tried 22.1 with that value set and i got the original "symbol not defined" error

johanatan17:09:37

looks like a regression along both axes

johanatan17:09:46

as 21.1 gave a more helpful error (which was that i needed to set that value)

johanatan17:09:13

oh, shoot. sorry. it doesn't work with 21.1 either with cljs which is what i really need here

johanatan17:09:33

the previous attempt for 21.1 was for clojure not cljs

dpsutton17:09:33

what was your previous cider version?

johanatan17:09:51

i've never gotten it to work with this project but i just upgraded to the new cider last week

dpsutton17:09:11

ah. i'm wondering if this is a regression or if this just never worked then

johanatan17:09:38

oh, hmm. well i'm pretty sure i've used TRAMP + CIDER before on other projects (but those were lein. this is first attempt for tools.deps)

johanatan17:09:35

but, just to confirm, if i start nrepl in clojure mode on a cljs project and then send a buffer to it, switch to that namespace and then trying calling a function, it will fail to find the function since it was a clj repl and not a cljs one?

dpsutton17:09:21

what does "in clojure mode" mean? cider-jack-in-clj?

johanatan17:09:36

the one associated with , ' in spacemacs

dpsutton17:09:47

i have no clue what that means or does

johanatan17:09:55

cider-jack-in

dpsutton17:09:09

ok. that's a clojure repl and it can't evaluate clojurescript

johanatan17:09:20

ah, yea, figured.

dpsutton17:09:21

if you jack in with cider-jack-in-cljs you can evaluate clojurescript

johanatan17:09:32

yea, but that fails 😞

johanatan17:09:46

with the "no conversion to symbol" error

dpsutton17:09:51

is this with tramp or without. i can't follow what circumstances we're discussing now

johanatan17:09:29

let me iterate the full setup: it's clj/tools.dep, clojurescript, tramp, nrepl 0.21.1 --or-- 0.22.1 .

dpsutton17:09:33

ok. so 21.1 with clj works, 21.1 with cljs fails with the symbol error, 22.x fails with symbol error in both clj and cljs

dpsutton17:09:55

,er, not cool but i understand now 🙂

johanatan17:09:36

i suppose removing tramp would be the path of least resistance forward for me

johanatan17:09:49

i.e., work locally.

dpsutton17:09:56

not sure if you've ever worked with elisp and CIDER before but you're probably the most qualified to work on this bug. A work product is by far the best testing ground to diagnose these issues

dpsutton17:09:04

how burdensome is that?

dpsutton17:09:14

but that does sound like the best temp solution

johanatan17:09:50

hehe, i will try to give it a look. otherwise, should i file an issue on the cider github?

dpsutton17:09:02

you should file an issue regardless

bozhidar15:09:48

@dpsutton There’s an updated version on master, but I hadn’t had time to cut a new release.

bozhidar15:09:53

Let me do this now.

dpsutton15:09:01

ah i thought that's what the release was based on. thanks

bozhidar16:09:18

@dpsutton I’ve pushed a new cider-nrepl release.

dpsutton16:09:25

0.22.2? i'll try it out

dpsutton16:09:33

nilWARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/property-names-and-types at line 26 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/property-names-and-types at line 26 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/oget at line 35 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/oget at line 40 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/starts-with? at line 34 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/oget at line 41 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/oget at line 35 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/properties-by-prototype at line 30 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/property-names-and-types at line 26 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs

robertkrahn16:09:27

When does this happen?

dpsutton16:09:04

our work project. figwheel, cljs 1.10.439. When editing a buffer while cider-connected

robertkrahn16:09:49

Thanks. will look into it.

dpsutton16:09:45

i think clj-suitable isn't ready for primetime yet

bozhidar16:09:01

Perhaps. That’s why I had suggested to @robertkrahn that maybe we should make it optional for now and have the users opt into it.

pez16:09:50

How would the user opt in?

robertkrahn16:09:17

Feel free to disable it or suggest what kind of switch you want. What's problematic is that various cljs engines tend to act quite differently and even core features such as dynamically loading code are implemented and act differently.

robertkrahn16:09:18

So right now I have lots of special handlers for figwheel / node / shadow etc in place but it will take a while - if it happens at all - to find and code around all the different behaviors. I only have limited time and only use figwheel so this will probably take a long time.

robertkrahn16:09:19

So an opt in solution might be best but this also means that most people will never see / hear of that feature. Please suggest how you prefer to parameterize that behavior.

bozhidar17:09:01

@robertkrahn I was thinking that we can just add an extra flag to the completion middleware request.

bozhidar17:09:30

In editors the value of this flag can be derived through some configuration option.

bozhidar17:09:11

Alternatively we can just keep it enabled only for figwheel and node have suitable do nothing with other REPLs.

bozhidar17:09:27

I think suitable is pretty cool, but I also completely understand how hard it is to reconcile the differences in all the ClojureScript REPLs.

dpsutton17:09:50

Just as a data point I was having issues on a figwheel project

pez17:09:53

With some holding hands, I can spend some time on fixing issues that creep up in suitable. Or at least try fix them.

dominicm18:09:02

I think the option should be something like inhibit-suitable-during-testing, meaning that the flag will become non operational in the future.

bozhidar18:09:45

I was thinking that we can just have the middleware take some optional params map where we can add some suitable flags for the time being - e.g. disable completely, disable for some REPL types, etc.