Commit Graph

2 Commits

Author SHA1 Message Date
a1ec51afc3 sitesmith: filter known-benign invariants from diagnostic shim
Craft.js uses several invariants as try/catched control-flow checks
(notably isDraggable -> 'A top-level Node cannot be moved' for ROOT and
linkedNode children). These fire on every render and are NOT errors —
they're how Craft.js asks 'should I attach drag to this node?'. Filter
them out of the shim's console.error so only genuinely-broken invariants
show up.
2026-05-24 16:37:08 -07:00
43627bddb0 sitesmith: alias tiny-invariant to a diagnostic shim
The prod build of tiny-invariant strips all failure messages, leaving
us with bare 'Error: Invariant failed' and no actionable info. Aliasing
the package to a shim that always emits the message + a stack-trace
console.error before throwing — so the next Craft.js invariant we hit
tells us which assertion (ERROR_NOT_IN_RESOLVER, ERROR_NOPARENT,
ERROR_INVALID_NODE_ID, etc.) is actually failing.

Temporary; will revert once the Sitesmith apply flow is stable.
2026-05-24 16:32:50 -07:00