Fork me on GitHub

Is there a better way to view Clojurescript error messages in CIDER? It's very awkward to have long messages like this printed out in the REPL, with no formatting or text wrapping. Even worse, they all just pile up before the empty prompt so it's very difficult to visually separate them. There must be a better way than this... Is there an option to have a properly formatted buffer pop-up? I'm using shadow-cljs.


I’ve never seen errors like that


Is there an actual error in your project? The auto complete has been a bit iffy with shadow. So perhaps it is that?


This particular error is indeed an unusual one... I'm getting a INTERNAL COMPILER ERROR after npm install --save jimp and using :require ["jimp" :as jimp] as you can see on the left hand side of my window. That's definitely something I'll bring up in #shadow-cljs, but right now all my compilation errors print out like this. Is this normal?


I thought I remembered clickable errors in the repl for cljs


I’d be interested to see a more traditional null pointer or whatever. I almost never look in the repl for stack traces since they are in the browsers console


It'd be great to clarify my understanding on this, which is that: 1. Successfully compiled ClojureScript will show errors from the generated JavaScript in the browsers console, and the browser's console is the best place to watch for those errors- not anywhere in CIDER or Emacs. Is that right? 2. If the ClojureScript cannot compile properly (syntax error, etc), it prints out an error message in the REPL in CIDER just below the previous output (with no formatting or text wrapping). The only way to watch for and read those error messages is to scroll up and down in the CIDER REPL. This is how I currently read errors that pop up from a shadow-cljs hot reload upon saving changes in a file. This is also what I'm hoping to find a better solution for.


I do find that, sometimes and for certain errors, my localhost:8080 in the browser will show a nicely formatted message from shadow-cljs that identifies a compilation error. But most of the time, it just prints it out in the repl and leaves an outdated version of the app showing in the browser, sometimes with a message like "shadow-cljs - The Websocket Connection was closed!"


I really do feel like I'm doing something wrong, because I've heard so many good things about this CIDER/ClojureScript/shadow-cljs developer experience in the inconsistencies here are very frustrating. If someone can point me in the right direction, I'd love to turn the knowledge into a comprehensive blog post for beginners.

❤️ 3

I’m sorry you’re having issues with non compiling code. I expect the browser console and the browser heads up display from shadow might have better information?


This is probably a weak spot of cider but I suspect it is nicer for “regular” errors


Oh, I'm just letting off some steam I guess. It's been much harder than I thought to get into a flow with these tools... There's a lot of complexity in the ClojureScript environment to wrap your head around when you're brand new to it. I really appreciate your getting back to me so quickly.


If you have a syntax error in your ClojureScript, like a missing bracket, where do you usually find out about it? In the REPL? I don't think those errors make it to the browser console, do they?


Yeah that’s true


I almost never have those. But the hud in the browser is where I’d expect to see it


Guess I'll just have to turn on strict parens. Thanks!


Oh yeah. I wouldn’t edit clojure without structural editing

🎉 3
David Pham04:06:00

Smart parens is golden. It changed the way I code for sure.

👍 3
David Pham04:06:59

@neil.hansen.31 did you use the ^dev/after-load metadata for shadow-CLJS? Usually a function wrapping dom/render entry point will be called every time you update your files.


That is something I'm using now, but it took me a little too long to find out about. The shadow-cljs user guide is very thorough, but as a beginner (to Clojure and shadow-cljs), it made my head spin. After I've wrapped my head around all this, I'd love to eventually help with the creation of some more beginner friendly materials.


If someone wanted auto-trimming of their REPL buffers you can check out


Love it!


> REPL shortcut trim. chefs_kiss.jpg