beginners

Eva 2025-09-27T18:51:13.139599Z

Hello! I can't get ClojureScript to work with emacs's Cider, can someone help me? I asked this on stackoverflow, they directed me here https://stackoverflow.com/questions/79776730/no-cider-error-buffer-and-no-stacktraces-with-shadow-cljs

seancorfield 2025-09-27T19:14:49.830759Z

Hi Eva, welcome! If you don't get a timely answer here in #beginners feel free to forward your post to #cider (I don't do ClojureScript and don't use Emacs, so I can't be much help, I'm afraid).

👍 1
seancorfield 2025-09-27T19:15:26.838339Z

(and there's also #shadow-cljs as Harold noted on SO)

liebs 2025-09-27T19:48:26.841659Z

the stacktraces should appear in whatever the shadow-cljs stdout is

liebs 2025-09-27T19:48:39.342469Z

which is probably the REPL buffer itself

liebs 2025-09-27T19:49:44.929959Z

if you evaluate something that throws an exception, you should still see the little :repl/exception inline result

cormacc 2025-09-27T20:02:08.964909Z

Yeah exactly - you'll see them in your browser console log. Also see some info in the CLJS repl if you have it open

Eva 2025-09-28T06:27:01.945909Z

The repl buffer tells me the exception, but not the stacktrace. If says something like "invalid arity: 1", but it doesn't show which function threw it and where the error occurred

Eva 2025-09-28T06:27:23.214879Z

Same for the console log

Eva 2025-09-28T06:27:51.144229Z

I see the exception, but I also want to see the stacktrace, like it works when I work with clj

liebs 2025-09-28T07:28:15.727969Z

The compilation/evaluation model is different, so I wouldn't expect to have the same workflow. CIDER captures Clojure stacktraces bc the source is being compiled and executed in one go; in ClojureScript, the compiler (a Clojure program) can error, in which case you might (I am frankly not certain) see a compiler stacktrace in your CIDER error buffer. But if you write code that causes a runtime exception, CIDER doesn't recover the error: it's happening in the JavaScript runtime of your choosing.

liebs 2025-09-28T07:31:29.113989Z

For the sake of comparison, this is what I can see when I evaluate code that throws:

------ WARNING - :fn-arity -----------------------------------------------------
 Resource: <eval>:1:1
 Wrong number of args (0) passed to cljs.core/identity
--------------------------------------------------------------------------------

Timeout while waiting for result.
I also get a little tooltip on the right-hand side of my buffer that says cljs.core/identity is called with 0 args but expects 1

liebs 2025-09-28T07:36:51.836359Z

here, for instance, I can trigger a compilation error with a bogus call to cljs.core// (that's divide):

[:client] Build failure:
------ ERROR -------------------------------------------------------------------
 File: /home/benl/bikeshed/cljs/niaiserie/src/main/lol/sudoscience/niaiserie/core.cljs:3:1
--------------------------------------------------------------------------------
   1 | (ns lol.sudoscience.niaiserie.core
   2 |   (:require [lol.sudoscience.niaiserie.handlers :as h]))
   3 | (/)
-------^------------------------------------------------------------------------
null
Wrong number of args (0) passed to: cljs.core//
in which case you get a line number and filename