From f50c65994253cd9484162b53fd173c92474b3f68 Mon Sep 17 00:00:00 2001 From: hufwin Date: Sat, 5 Sep 2026 17:16:52 +0300 Subject: [PATCH] Fix dekey reading Elm's tuple field from keyed children MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _VirtualDom_dekey still read keyedKids[i].b, the field of Elm's (key, node) tuples. Gren's keyed children are { key, node } records, which every other kernel site reads through __$node. On the diff path where an old plain node meets a new keyed node at the same index, dekey therefore produced a node whose children were all undefined, and the following redraw crashed with "Cannot read properties of undefined (reading '$')", after which the real DOM and the virtual one never agreed again. Verified against a minimal reproduction — a keyed node last in a child list whose shape changes across an update: the untouched kernel crashes on the first update, this change alone stops it, and reverting brings the crash back. --- src/Gren/Kernel/VirtualDom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gren/Kernel/VirtualDom.js b/src/Gren/Kernel/VirtualDom.js index 6dd1998..03ffbf7 100644 --- a/src/Gren/Kernel/VirtualDom.js +++ b/src/Gren/Kernel/VirtualDom.js @@ -1477,7 +1477,7 @@ function _VirtualDom_dekey(keyedNode) { var kids = new Array(len); for (var i = 0; i < len; i++) { - kids[i] = keyedKids[i].b; + kids[i] = keyedKids[i].__$node; } return {