Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation from filtered collection views causes "Cannot read properties of undefined (reading 'field')" error #9179

Open
moonclavedev opened this issue Nov 13, 2024 · 0 comments
Labels
status: needs-triage Possible bug which hasn't been reproduced yet v3

Comments

@moonclavedev
Copy link

moonclavedev commented Nov 13, 2024

Describe the Bug

Cannot read properties of undefined

When visiting a filtered collection view via directly pasting in the url in the browser, console logs the following error:

6215-33228227b1b5a70c.js:1 TypeError: Cannot read properties of undefined (reading 'field')
    at hJ (5f45121c-8695c11f63b2c600.js:1:531097)
    at lb (4bd1b696-b885e18b0305f700.js:1:41542)
    at aY (4bd1b696-b885e18b0305f700.js:1:61269)
    at on (4bd1b696-b885e18b0305f700.js:1:72672)
    at ui (4bd1b696-b885e18b0305f700.js:1:111670)
    at 4bd1b696-b885e18b0305f700.js:1:111521
    at uo (4bd1b696-b885e18b0305f700.js:1:111529)
    at i3 (4bd1b696-b885e18b0305f700.js:1:108657)
    at uF (4bd1b696-b885e18b0305f700.js:1:128286)
    at MessagePort.T (6215-33228227b1b5a70c.js:1:103285)

Image

Application Error when Navigating

When navigating away from a filtered collection view in the admin panel, the application crashes with a client-side error:

"Application error: a client-side exception has occurred (see the browser console for more information)"

Image

Link to the code that reproduces this issue

https://github.com/moonclavedev/payload-vercel

Reproduction Steps

Steps to Reproduce

  1. Fresh install of Payload 3.0 + Vercel (using the template from @payloadcms/payload/tree/beta/templates/with-vercel-postgres)
  2. Navigate to any collection
  3. Apply a filter
  4. Copy generated url from address bar, paste into a new tab (e.g., https://example.com/admin/collections/users?limit=10&page=1&where[or][0][and][0][email][equals][email protected])
  5. Click any navigation item in the sidebar
  6. Observe the application crash with the "field" undefined error

Expected Behavior

Navigation should work normally when moving away from filtered collection views.

Actual Behavior

The application crashes with a client-side exception related to undefined field properties.

Additional Context

  • The error occurs consistently when navigating away from any filtered collection view
  • Direct URL navigation to filtered views works fine
  • All API requests complete successfully (200 status codes)
  • The issue appears to be related to field initialization in the admin UI

Which area(s) are affected? (Select all that apply)

area: ui, area: core

Environment Info

payload: 3.0.0-beta.129
next: 15.0.0
Node: 20.11.1
@moonclavedev moonclavedev added status: needs-triage Possible bug which hasn't been reproduced yet v3 validate-reproduction labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet v3
Projects
None yet
Development

No branches or pull requests

1 participant