Repository navigation
Description
Summary
bb wraps Node.prototype.insertBefore at startup. The wrapper only treats a reference node of exactly null as "append", so parent.insertBefore(node, undefined) throws TypeError: Cannot read properties of undefined (reading 'parentNode'). Native DOM accepts undefined there and appends. Solid 2 passes undefined, so a plugin frontend that renders with Solid crashes on its first list (<For>) insertion.
Versions and environment
- bb desktop 0.50.1 (latest release), Linux (CachyOS, kernel 7.3.5)
- Code cited below is unchanged on
mainatb0ddaad731565d7e4de68d824120d802fc78f7d5 - No provider involved
Steps to reproduce
- Open any thread in bb.
- In DevTools, run:
const p = document.createElement("div"); document.body.append(p); p.insertBefore(document.createElement("span"), undefined);
Did not reproduce with the native method: calling the native insertBefore from a fresh iframe's Node.prototype with the same arguments appends the span.
Expected vs actual
Actual (bb page): TypeError: Cannot read properties of undefined (reading 'parentNode')
Native (iframe): appends, p.childNodes.length === 1
Expected: same as native. Per the DOM spec, insertBefore(node, undefined) converts undefined to null and appends.
In a plugin frontend built with Solid 2 (@solidjs/web 2.0.4) the same throw shows up as:
TypeError: Cannot read properties of undefined (reading 'parentNode')
at HTMLUListElement.k [as insertBefore] (…/assets/index-….js)
[error] [REACTIVITY_HALTED]
and the slot is disabled by bb's crash boundary.
Evidence
- The guard is installed unconditionally at startup:
apps/app/src/main.tsx#L25 - The null-only check:
apps/app/src/lib/foreign-dom-mutation-guard.ts#L257-L271. Withchild === undefined,child !== nullis true andchild.parentNodethrows. - Suggested fix (not tested in bb):
child != nullon line 261, or normalizechild ?? nullat the top of the wrapper. - Plugin-side workaround that confirms the cause: wrapping the guarded method to pass
child ?? nullmakes the Solid 2 plugin render and update correctly.
What you ruled out
- Not Pending async content-script mount makes the DOM guard refuse bb's own React commits (plugin overlay container never mounts) #5836: that one is the guard refusing bb's own React commits while an async content-script mount is pending. This one is a TypeError on any
insertBeforecall with anundefinedreference node, with no plugin mount pending. - Not specific to Solid: the plain DevTools snippet above reproduces it.
- Searched open and closed issues for
insertBefore,foreign-dom-mutation-guardand "DOM guard": no match.
Suggested priority and effort
Low priority: it hits plugin authors whose UI library passes undefined, and a plugin-side workaround exists. Effort: low (one comparison).
Checks
- I reproduced this on the latest release (0.50.1); the cited code is unchanged on
mainatb0ddaad731565d7e4de68d824120d802fc78f7d5. - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATEDand links the thread or report.
Found while prototyping a bb plugin frontend in Solid 2 (local bb thread, not public).
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 26, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotplugins,confirmed-repro. No existing classification was replaced; High reflects a plugin rendering crash.Preserve native append behavior in the DOM insertion guard (get-bb#8238)
Preserve native append behavior in the DOM insertion guard (get-bb#8238)