There seems to be some issue in the browser when any file which uses clerk/with-viewer throws a runtime error, the entire page turns blank and has to be manually refreshed (instead of showing the usual red error header and stacktrace)
I was wrong about that. It used to be resolved on main until 31326c1f2854e3f23f7cb15bb43cb3f561ad579e but then it broke with 8d2929b99cfa2164f1fbaf54915b9dcaaa6fe46d (which fixed a similar, but slightly different issue).
Minimal repro:
(ns repro
(:require [nextjournal.clerk :as clerk]
[nextjournal.clerk.viewer :as clerk.v]))
(clerk/with-viewer clerk.v/string-viewer "glub")
;; (throw (ex-info "whoops" {}))
Start a server with file watchers, and clerk/show! this namespace, then uncomment the last line and save the fileThis issue occurs without watchers and manually refreshing via clerk/show! , and doesn't seem to depend on the type of exception being thrown (eg. (inc nil) ).
The browser console reports a whole bunch of TypeErrors from what appears to be minified React code:
TypeError: b is null react-dom.production.min.js:183:23
oy Immutable
tna component.cljs:423
Hna template.cljs:128
Ina template.cljs:131
Qna template.cljs:234
qg formatting.cljs:162
$x clojure_mode.cljs:53
pna component.cljs:317
qna component.cljs:364
rna component.cljs:394
aw util.cljs:234
Wla ratom.cljs:337
rna component.cljs:392
c component.cljs:410
React 6
l scheduler.production.min.js:12
Y scheduler.production.min.js:14
93 scheduler.production.min.js:12
zl core.cljs:11933
95 scheduler.production.min.js:20
zl core.cljs:11933
96 React
zl core.cljs:11933
98 React
zl core.cljs:11933
99 React
zl core.cljs:11933
Al core.cljs:12115
parser.cljc:321 This appears to be triggered by a top-level clerk/with-viewer / with-viewers anywhere within the file, regardless of the arguments it is given.
I could open an issue on Github if necessary , couldn't find anything similar reported elsewhere π
Would you please file a Github issue for this with the same info as above, plus the OS and browser versions youβre using?
will do, thanks!
I answered, pretty sure itβs resolved on main