clerk

Ellis 2023-12-05T08:56:04.154449Z

I'm on io.github.nextjournal/clerk {:git/sha "e8f275b5cf077ec9441e404c1885ff0b6ee0aef9"} and I've noticed I'm suddenly having issues with exception/error reporting. I rarely get the expected error popup until I restart my serve process, otherwise I get a blank notebook. I've recorded a sample below (spoilers for aoc day 5, for trivial cases it seems to be fine. Also bear with the loading, I think it's because I was also capturing the video) No errors in the browser console other than it trying to render a null element

Ellis 2023-12-09T16:54:08.671189Z

Seems to still work fine, but it points out that stack trace CSS might need some changes for larger displays πŸ˜„

mkvlr 2023-12-09T18:38:09.160569Z

@elken thanks for checking! And come color adjustments.

Ellis 2023-12-09T19:13:33.218149Z

I'm overriding some of them in CSS, but yeah the stack trace parent just needs an overflow like this (maybe some padding so the scrollbar doesn't overlap)

πŸ‘ 1
Andrea 2023-12-05T10:33:59.084899Z

hi @elken. Unfortunately I cannot reproduce this issue with the same clerk version. I’m causing the same exception (assoc on cons) but the error message renders as expected when the expression is evaluated. Maybe we need more context to reproduce, or the notebook source...

Ellis 2023-12-05T10:38:06.394299Z

Sure, my repo is https://github.com/elken/aoc; I can replicate it with pretty much any notebook, I randomly picked 2023/day04 and changed one of the functions to be an invalid symbol and it triggered. Huh, interesting note that I have a block at the start of all my solution notebooks to pull the problem HTML from AOC; if I comment that out it seems to work fine...

Andrea 2023-12-05T10:39:38.996249Z

ok, thanks!

Andrea 2023-12-05T13:33:35.760959Z

I think we were able to reproduce the issue, thank you for reporting

Ellis 2023-12-05T13:34:06.288809Z

Great! πŸ˜„

Andrea 2023-12-05T16:25:20.827749Z

Not merged yet, but that’d be great if you could give "eb89e0b2e9edf8937c7c4a14c6df0ebc3217adeb" a spin and see if it still reproduces?

Ellis 2023-12-05T16:25:31.563239Z

Sure thing!

πŸ™ 1
Ellis 2023-12-05T16:27:18.943589Z

Seems to be fixed! What was it in the end?

Andrea 2023-12-05T16:28:05.944749Z

when catching exception we’d leave garbage in the data which we send to the client

Andrea 2023-12-05T16:28:15.410929Z

https://github.com/nextjournal/clerk/pull/587

Andrea 2023-12-05T16:28:41.102849Z

thanks for testing out!

Ellis 2023-12-05T16:29:13.205159Z

Ahh, makes sense actually. Thanks for such a swift resolution πŸ˜„

mkvlr 2023-12-07T19:20:39.025229Z

@elken I think https://github.com/nextjournal/clerk/pull/588 is another take on that same problem. You’re using cider, right? Cider overrides the printing of functions to be unreadable in tools.reader based readers like edamame:

(pr-str (comp inc dec))
;; => "#function[clojure.core/comp/fn--5892]"

Ellis 2023-12-07T19:21:30.970429Z

Not with my aoc notebooks no

mkvlr 2023-12-07T20:07:55.656399Z

ok, well anyway. Made some tweaks to the PR and merged it into main. Please let me know if it still works. πŸ™

Ellis 2023-12-07T20:13:20.083589Z

I won't be able to tonight but I will report when I can :)

mkvlr 2023-12-07T20:17:30.789229Z

no rush at all, thank you, also for the report!