Frontmatter
| id | 8870 |
| title | Investigate VNode.getById(null) error in Container.onScrollCapture |
| state | Closed |
| labels | bugaicore |
| assignees | tobiu |
| createdAt | Jan 23, 2026, 9:00 PM |
| updatedAt | Jan 23, 2026, 10:35 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8870 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 23, 2026, 10:35 PM |
Investigate VNode.getById(null) error in Container.onScrollCapture

Input from Gemini 3 Pro:
✦ Clarification: This error was observed during an experimental branch where
_vnodestate was being actively modified/nullified during updates. It may not be currently reproducible on thedevbranch.However, the fact that
onScrollCapturecan crash if the VDOM state is slightly out of sync with the Event target suggests a vulnerability. The fix should focus on graceful handling (e.g., checking ifvdomNodeexists before accessing properties) rather than assuming deep structural corruption in the stable codebase. This is a hardening task.

Input from Gemini 3 Pro:
✦ I have applied the hardening fix to both
src/util/VNode.mjsandsrc/util/VDom.mjs.Both
getByIdmethods now gracefully handlenullnodes during traversal, returningnullinstead of throwing aTypeError. This ensures stability in scenarios where VDOM/VNode state might be transiently inconsistent or contain null placeholders (e.g., during unmounts or race conditions).Changes committed and pushed to
feat/card-incremental-updates. Closing ticket.
Description: During a feasibility analysis for Card Layout optimization, a runtime error was observed in the Portal App when switching tabs quickly or triggering layout updates:
VNode.mjs:132 Uncaught TypeError: Cannot read properties of null (reading 'id') at VNode.getById (VNode.mjs:132:27) at Container.onScrollCapture (Abstract.mjs:423:31) at Container.onScrollCapture (Base.mjs:1454:15)Context: The error occurs in
onScrollCapture, which attempts to look up a VDOM node by ID usingVDomUtil.getById(me._vdom, data.target.id). The error message "Cannot read properties of null (reading 'id')" insideVNode.getByIdsuggests thatme._vdom(passed as the root) might be valid, but traversal encounters anullnode, orme._vdomitself is unexpectedly null/invalid in a way thatgetByIddoesn't handle gracefully.Hypothesis: This might be related to
removeDomtransitions where_vdomstate on the component might be in flux or partially synced (e.g._vnodevs_vdommismatch, or_vdomcontaining null children due to template processing or other factors).Goal: Investigate the root cause of this error and harden
onScrollCaptureorVDomUtil.getByIdagainst null/invalid inputs.