Skip to content

findIndex error saving localized collection with plugin-nested-docs #12209

@mikexavier

Description

@mikexavier

Describe the Bug

Attempting to save after switching locales and editing a localized field (like title) triggers a client-side TypeError: Cannot read properties of undefined (reading 'findIndex'). This crashes the save operation.

Link to the code that reproduces this issue

https://github.com/mikexavier/payload-nested-docs-bug

Reproduction Steps

  1. Create a new Category
  2. Enter a title in 'en'
  3. Save
  4. Switch locale toggle to 'de'
  5. Enter a title in 'de'
  6. Save
payload-nested-docs-bug-1.mov

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

area: ui, plugin: nested-docs

Environment Info

Binaries:
  Node: 20.12.2
  npm: 10.5.0
  Yarn: 1.22.22
  pnpm: 9.15.0
Relevant Packages:
  payload: 3.35.1
  next: 15.3.0
  @payloadcms/email-nodemailer: 3.35.1
  @payloadcms/graphql: 3.35.1
  @payloadcms/next/utilities: 3.35.1
  @payloadcms/payload-cloud: 3.35.1
  @payloadcms/plugin-nested-docs: 3.35.1
  @payloadcms/richtext-lexical: 3.35.1
  @payloadcms/translations: 3.35.1
  @payloadcms/ui/shared: 3.35.1
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000
  Available memory (MB): 65536
  Available CPU cores: 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions