You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Account view crashes with "Cannot use 'in' operator to search for 'hidden' in undefined" on a minimal auth collection (3.89.0, Next 16.3.4) #18162
After creating the first user, Payload redirects to /admin/account. That view throws during server render and the app's error boundary catches it. Every other admin view (collections list, list view, edit, create) renders fine for the same user.
Stack (production, Vercel, Node 22):
TypeError: Cannot use 'in' operator to search for 'hidden' in undefined
at fieldIsHiddenOrDisabled (payload/dist/fields/config/types.js:41)
at renderField (@payloadcms/ui/dist/forms/fieldSchemasToFormState/renderField.js:153) // fieldIsHiddenOrDisabled(clientField)
at addFieldStatePromise → iterateFields → buildFormState
at Account view (@payloadcms/next/dist/views/Account/index.js:83, renderAllFields: true, schemaPath: collectionConfig.slug)
clientField comes from clientFieldSchemaMap.get(schemaPath) and is undefined for at least one field the server-side iteration visits, so the hidden/disabled check dereferences undefined.
Config: postgresAdapter, lexicalEditor(), sharp, custom routes.admin, one other collection (posts, plain text/textarea/date/select/richText fields). Import map regenerated for 3.89.0. Single copy of every @payloadcms/* package (npm ls deduped).
Same crash on 3.90.2 (Next 16.3.6, Vercel, Supabase Postgres), and not only on /admin/account: after completing /create-first-user, the create and edit views of the auth collection (/admin/collections/users/create, /admin/collections/users/<id>) rendered only the header, with the same stack (fieldIsHiddenOrDisabled <- renderField). Other collections were fine.
The trigger we found is consistent with #18168: CreateFirstUserClient's onChange calls getFormState with no user and without skipClientConfigAuth, so buildFormState hands getClientSchemaMap the unauthenticated client config (auth collection reduced to { slug, auth }), and the resulting map is cached per slug for the life of the process. The server render of /create-first-user itself uses skipClientConfigAuth: true, so in a single process the full map usually gets cached first; the bug appears when one of those anonymous form-state requests is the first to reach a fresh instance, which is common on serverless. A redeploy made it disappear for us.
We reproduced it deterministically with two next start instances of the same production build on one empty database (type in the create-first-user form on instance A, replay the resulting form-state request on instance B, then open the users views on B). A local patch that stops caching the map built from the unauthenticated config (same idea as #18168) fixes it.
Activity
bouchetcyril-commits commentedon Sep 29, 2026
Same crash on 3.90.2 (Next 16.3.6, Vercel, Supabase Postgres), and not only on
/admin/account: after completing/create-first-user, the create and edit views of the auth collection (/admin/collections/users/create,/admin/collections/users/<id>) rendered only the header, with the same stack (fieldIsHiddenOrDisabled<-renderField). Other collections were fine.The trigger we found is consistent with #18168:
CreateFirstUserClient'sonChangecallsgetFormStatewith no user and withoutskipClientConfigAuth, sobuildFormStatehandsgetClientSchemaMapthe unauthenticated client config (auth collection reduced to{ slug, auth }), and the resulting map is cached per slug for the life of the process. The server render of/create-first-useritself usesskipClientConfigAuth: true, so in a single process the full map usually gets cached first; the bug appears when one of those anonymous form-state requests is the first to reach a fresh instance, which is common on serverless. A redeploy made it disappear for us.We reproduced it deterministically with two
next startinstances of the same production build on one empty database (type in the create-first-user form on instance A, replay the resulting form-state request on instance B, then open the users views on B). A local patch that stops caching the map built from the unauthenticated config (same idea as #18168) fixes it.(Investigation done with Claude Code.)