`insertBefore` in the customer account extension runtime leaves `nextSibling` stale, so Preact lists stop updating

In a customer account UI extension, insertBefore() with a reference node that already has a previous sibling doesn’t update that sibling’s nextSibling, and returns undefined instead of the inserted node. The host still renders the right thing, but Preact walks nextSibling when it diffs children, so once a keyed list grows in the middle the extension stops updating.

This matches the bug fixed in @remote-dom/polyfill 1.6.0 (Shopify/remote-dom#620). Could the extension runtime move to 1.6.0 or later?

Environment

  • Target: customer-account.page.render
  • API versions: 2026-07 and 2026-10 (same behaviour on both)
  • @shopify/ui-extensions/preact, Preact 10.29.8

Check

Run inside the extension:

const parent = document.createElement('div');
const [a, b, c] = ['a', 'b', 'c'].map((text) => document.createTextNode(text));
parent.append(a, c);
const returned = parent.insertBefore(b, c);
console.log(a.nextSibling === b, returned === b);

A browser and @remote-dom/polyfill 1.6.0 log true true. The extension runtime logs false false, as does @remote-dom/polyfill 1.5.1.

What customers see

Our add-product dialog has a search field, a few s-clickable-chip filters and an s-grid of keyed s-clickable cards. Searching narrows the grid as expected. Clearing the search puts cards back between the ones that stayed, and from then on typing doesn’t change the results and the chips do nothing.

Rendering the same component in Node on @remote-dom/polyfill 1.5.1 reproduces it: after the first clear, the re-added cards are missing from the nextSibling chain and later updates go wrong from there. Preact 10.29.8 also relies on insertBefore’s return value, which makes it worse.

Workaround

At startup we run the check above, and if it fails we wrap insertBefore to relink the previous sibling and return the node, as 1.6.0 does. It depends on the polyfill’s private next symbol, so we’d like to remove it.

Questions

  1. Which @remote-dom/polyfill version does the customer account extension runtime use?
  2. Is there a plan to update it to 1.6.0 or later?
5 Likes