Skip to content

Error when join field has access query on virtual field #15332

@Xmaster6y

Description

@Xmaster6y

Describe the Bug

I have a collection Roles which is virtually linked to Projects and in relation Tenant. In the read access of Roles I query using the virtual field tenantSlug (tenant.slug).

The error happens when I list Projects, e.g. /api/projects but not when I list roles /api/roles

Maybe related to #12884

Link to the code that reproduces this issue

https://github.com/Xmaster6y/debug-join

Reproduction Steps

  1. Run pnpm run dev
  2. Go to /api/projects

Which area(s) are affected?

area: core

Environment Info

Binaries:
  Node: 24.8.0
  npm: 11.6.0
  Yarn: 1.22.22
  pnpm: 10.17.0
Relevant Packages:
  payload: 3.72.0
  next: 15.4.10
  @payloadcms/db-sqlite: 3.72.0
  @payloadcms/drizzle: 3.72.0
  @payloadcms/graphql: 3.72.0
  @payloadcms/next/utilities: 3.72.0
  @payloadcms/richtext-lexical: 3.72.0
  @payloadcms/translations: 3.72.0
  @payloadcms/ui/shared: 3.72.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:29:54 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T8122
  Available memory (MB): 16384
  Available CPU cores: 8

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions