Unknown components throw instead of rendering error box

render-dom-unknown-component now calls (error ...) instead of
creating a styled div. This lets tryEvalContent catch the error
and fall back to server fetch, instead of rendering "Unknown
component: ~name" into the page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 22:12:59 +00:00
parent b98a8f8c41
commit bcb58d340f
2 changed files with 3 additions and 12 deletions

View File

@@ -286,11 +286,7 @@
(define render-dom-unknown-component
(fn (name)
(let ((el (dom-create-element "div" nil)))
(dom-set-attr el "style"
"background:#fef2f2;border:1px solid #fca5a5;color:#991b1b;padding:4px 8px;margin:2px;border-radius:4px;font-size:12px;font-family:monospace")
(dom-append el (create-text-node (str "Unknown component: " name)))
el)))
(error (str "Unknown component: " name))))
;; --------------------------------------------------------------------------