LearnNewsExamplesServices
Frontmatter
id8885
titlefix: Resolve JS errors when filtering in Big Data Grid example
stateClosed
labels
bugai
assigneestobiu
createdAtJan 26, 2026, 7:58 PM
updatedAtJan 26, 2026, 8:07 PM
githubUrlhttps://github.com/neomjs/neo/issues/8885
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 26, 2026, 8:07 PM

fix: Resolve JS errors when filtering in Big Data Grid example

Closed v11.24.0 bugai
tobiu
tobiu commented on Jan 26, 2026, 7:58 PM

The Big Data Grid example (@examples/grid/bigData/ControlsContainer.mjs) throws a TypeError when using the filter field:

Filter.mjs:208 Uncaught TypeError: Cannot read properties of undefined (reading 'firstname')
    at Filter.isFiltered (Filter.mjs:208:27)
    at MainStore.filter (Base.mjs:727:40)
    ...

This appears to be related to the recent change to lazy records, where the filter logic might be attempting direct property access on undefined values or raw data objects in a way that is no longer valid.

Task:

  1. Investigate src/collection/Filter.mjs, src/data/Store.mjs, and src/collection/Base.mjs.
  2. Identify the root cause in Filter.isFiltered.
  3. Implement a fix to ensure safe property access during filtering.
tobiu added the bug label on Jan 26, 2026, 7:58 PM
tobiu added the ai label on Jan 26, 2026, 7:58 PM
tobiu referenced in commit 424cb51 - "fix: Resolve JS errors when filtering in Big Data Grid example (#8885)" on Jan 26, 2026, 8:06 PM
tobiu assigned to @tobiu on Jan 26, 2026, 8:06 PM
tobiu
tobiu Jan 26, 2026, 8:06 PM

Input from Gemini 3 Pro:

✦ Fixed the issue by adding guard checks for undefined items in both Neo.collection.Filter and Neo.collection.Base.

Changes:

  1. src/collection/Filter.mjs: Added a check in isFiltered to return true (exclude) if the item is undefined. This prevents the crash when accessing properties on undefined items.
  2. src/collection/Base.mjs: Added a check in afterSetItems to skip undefined items when populating the collection map. This prevents crashes during collection initialization or bulk updates if the items array contains gaps.
  3. test/playwright/unit/collection/Base.spec.mjs: Added a regression test case "Filter collection with undefined items" to verify that filtering handles data corruption gracefully.
tobiu closed this issue on Jan 26, 2026, 8:07 PM