Skip to content

Upload field in block crashes when hasMany: true + localized: true are both set, with Postgres #15067

@omaroubari

Description

@omaroubari

Describe the Bug

An upload field configured with both hasMany: true and localized: true throws an error at runtime when inside a block. If either hasMany or localized is removed, or the blocks field has localized: true everything works as expected. Using both together consistently triggers the crash. Using Postgres adapter.

Error
⨯ unhandledRejection: undefined
⨯ [Error: Error: cannot connect to Postgres: Cannot read properties of undefined (reading 'Symbol(drizzle:Name)')] {
digest: '4167195182'
}

Expected behavior

A localized hasMany upload field should work (store different media arrays per locale), in non-localized blocks field.

Actual behavior

App crashes with the error above when both options are enabled together.

Link to the code that reproduces this issue

https://github.com/omaroubari/payloadcms-upload-field-bug

Reproduction Steps

  1. Clone repo and run pnpm install
  2. Set up PG connection string
  3. Load admin panel -> error should throw
  4. Uncomment line 34 of src/collections/Pages.ts -> should work normally, but now the entire field has to be localized

Which area(s) are affected?

db: postgres, db: vercel-postgres

Environment Info

Binaries:
  Node: 24.3.0
  npm: 11.4.2
  Yarn: N/A
  pnpm: 10.26.1
Relevant Packages:
  payload: 3.69.0
  next: 15.4.10
  @payloadcms/db-d1-sqlite: 3.69.0
  @payloadcms/db-postgres: 3.69.0
  @payloadcms/drizzle: 3.69.0
  @payloadcms/email-resend: 3.69.0
  @payloadcms/graphql: 3.69.0
  @payloadcms/live-preview: 3.69.0
  @payloadcms/live-preview-react: 3.69.0
  @payloadcms/next/utilities: 3.69.0
  @payloadcms/plugin-cloud-storage: 3.69.0
  @payloadcms/plugin-form-builder: 3.69.0
  @payloadcms/plugin-mcp: 3.69.0
  @payloadcms/plugin-nested-docs: 3.69.0
  @payloadcms/plugin-redirects: 3.69.0
  @payloadcms/plugin-search: 3.69.0
  @payloadcms/plugin-seo: 3.69.0
  @payloadcms/richtext-lexical: 3.69.0
  @payloadcms/sdk: 3.69.0
  @payloadcms/storage-r2: 3.69.0
  @payloadcms/translations: 3.69.0
  @payloadcms/ui/shared: 3.69.0
  react: 19.2.1
  react-dom: 19.2.1
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
  Available memory (MB): 24576
  Available CPU cores: 12

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