Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

WhereBuilder throws "Cannot read properties of undefined (reading 'value')" when the list URL filters on a field that is not filterable

Open Beginner friendly
#19,002 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@paurushrai is already working on this.

Since Oct 23, 2026.

  • #19003 by @paurushrai — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Domain
frontend, testing

Research direction

Start with packages/ui/src/elements/WhereBuilder/Condition/index.tsx and packages/ui/src/elements/WhereBuilder/index.tsx, where the issue traces the undefined field and the unguarded field.value access. Reproduce with a where URL that names a nonexistent or unreadable field, then inspect nearby tests for filter conditions. Done means the filter row still renders and loading that URL raises no unhandled rejection.

Written by the indexing model from the issue text.

Description

Bug
Describe the Bug

Opening a collection list view whose URL where query references a path that is not among the filterable fields causes an unhandled promise rejection about 300ms after the filters render:

TypeError: Cannot read properties of undefined (reading 'value')
    at WhereBuilder.useCallback[updateCondition] (packages/ui/src/elements/WhereBuilder/index.tsx)
    at Condition.useEffectEvent[updateValue] (packages/ui/src/elements/WhereBuilder/Condition/index.tsx)
    at Condition.useEffect

The filter row itself renders fine (empty field select). Nothing breaks visually, but every such page load raises an unhandled rejection. In dev, Next.js shows "1 Issue". In production it reaches error monitoring as an unhandledrejection. We found it in production through Grafana Faro on /admin/collections/posts/.

Realistic ways to get there:

  • A shared or bookmarked list URL that filters on a field that was later renamed or removed.
  • A shared list URL that filters on a field the current user cannot read. Since #14118, reduceFieldsToOptions drops fields without read access from the filter options.

Cause: Condition resolves its field with reducedFields.find((field) => field.value === fieldPath), which is undefined for these paths. Its debounced value effect still calls updateCondition({ type: 'value', field: reducedField, ... }) on mount. updateCondition then reads field.value without a guard, inside an async callback, so the rejection is unhandled.

The same trigger (pasting a filtered list URL) crashed at a different spot in #9179, fixed in #9276. On main this is already guarded (field?.fieldPath, from #16810), so it only affects 3.x.

Link to the code that reproduces this issue

https://github.com/paurushrai/payload-wherebuilder-unknown-field

Reproduction Steps
  1. Clone the repo above (stock [email protected] -t blank, SQLite). The only change: Users has a field with access: { read: () => false }.
  2. cp .env.example .env and set PAYLOAD_SECRET.
  3. npm install && npm run dev, then open http://localhost:3000/admin and create the first user.
  4. Open either URL:
    • http://localhost:3000/admin/collections/users?where[or][0][and][0][internalNote][equals]=x (field the user cannot read)
    • http://localhost:3000/admin/collections/users?where[or][0][and][0][doesNotExist][equals]=x (field that does not exist)
  5. Open the browser console. About 300ms after load: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'value').

Expected: the row renders and nothing throws.

Which area(s) are affected?

area: ui

Environment Info
Binaries:
  Node: 24.18.0
  npm: 11.16.0
  pnpm: 11.28.6
Relevant Packages:
  payload: 3.92.0
  next: 16.3.3
  @payloadcms/db-sqlite: 3.92.0
  @payloadcms/ui/shared: 3.92.0
  react: 19.2.6
  react-dom: 19.2.6
Operating System:
  Platform: darwin
  Arch: arm64

Also seen on payload 3.85.2 with @payloadcms/db-postgres, Next 16.2.10, in production.

Dominant language
TypeScript
Stars
45.5k
Forks
4.3k
Avg merge
1d 19h
Merged PRs (30d)
299

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from payloadcms/payload

All issues in payloadcms/payload

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.