Wrong type argument error
Closed this issue · 15 comments
When I tried running this in Spacemacs I got the following error when using the C-c s t p
command:
(wrong-type-argument char-or-string-p nil)
write-resp-val-to-buf(nil #<buffer *sayid-traced*>)
sayid-setup-buf(nil t nil)
sayid-req-insert-meta-ansi(("op" "sayid-show-traced" "ns" nil))
sayid-show-traced()
sayid-trace-ns-by-pattern()
call-interactively(sayid-trace-ns-by-pattern nil nil)
command-execute(sayid-trace-ns-by-pattern)
I was using the newest development version (develop branch) with the default clojure layer. Sayid was added as an additional package using a melpa recipe from github:
(sayid :location (recipe :fetcher github :repo bpiel/sayid :files ("src/el/*.el")))
How should I fix this?
Do you have cider connected to nrepl?
I did, I used cider-jack-in
@bpiel Seems to be working now. Not sure what was going, sorry to bother you. Maybe I just needed to restart emacs (I thought I did that).
@DonyorM No problem. I like hearing that sayid is being used (or attempted) and appreciate having an official report of it working with spacemacs. thanks
@bpiel I'm working on integrating it with the clojure layer. Not working perfectly yet, I may be back later :)
Ok I figured out the original error. On my own project (which has only one namespace) it seems to trace fine. However, if I try and trace the contrived example (either with a wildcard or without) it gives the error I said above. I have no idea why.
@DonyorM that is weird. Do you get any exception output from the repl? I'll think about how to tackle this.
I am actually, I didn't notice that. It says
FAIL in (test1) (machine_test.clj:23)
expected: (= (-> test-vending-machine (m/insert-coin :quarter) (m/insert-coin :dime) (m/insert-coin :nickel) (m/insert-coin :penny) (m/press-button :a1)) expected-vending-machine)
actual: (not (= {:inventory {:a1 {:name :taco, :price 0.85, :qty 9}}, :coins-inserted [], :coins-returned [:quarter :quarter :nickel], :dispensed {:name :taco, :price 0.85, :qty 10}, :err-msg nil} {:inventory {:a1 {:name :taco, :price 0.85, :qty 10}}, :coins-inserted [:quarter :dime :nickel :penny], :coins-returned [], :dispensed nil, :err-msg true}))
However, I get the same error when I try to trace the functions in the non-test namespace (contrived-example.machine) I get the same emacs error, but no output on the repl. It may not be related
@DonyorM How are you including sayid in the clj project? Is it in your profiles.clj? The contrived-example project doesn't include it directly (in project.clj), so maybe sayid isn't loaded at all?
That would do it. Sorry I for some reason didn't think to check if it was loaded in the project. I'll add that and try it again, though I imagine that's the issue.
A better error message for this situation would be very helpful, if that's possible (I don't know elisp at all).
There should definitely be a better error message.
Confirmed the issue was the missing sayid plugin in the project.