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

Example issue "Field config not found for _users.auth.tenants.tenant" #10270

Open
MrLijan opened this issue Dec 30, 2024 · 3 comments
Open

Example issue "Field config not found for _users.auth.tenants.tenant" #10270

MrLijan opened this issue Dec 30, 2024 · 3 comments
Assignees
Labels
prioritized status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@MrLijan
Copy link

MrLijan commented Dec 30, 2024

Describe the Bug

I tried using the multi-tenant example and it fails when trying to display the Tenant field when creating a new user.
I also tried changing the array-type field tenants into a group-type, and it worked.

Also tried creating an array-type field with relationship to Pages and it didn't work

here is the users config:

const Users: CollectionConfig = {
  slug: 'users',
  access: {
    create: createAccess,
    delete: updateAndDeleteAccess,
    read: readAccess,
    update: updateAndDeleteAccess,
  },
  admin: {
    useAsTitle: 'email',
  },
  auth: true,
  endpoints: [externalUsersLogin],
  fields: [
    {
      name: 'roles',
      type: 'select',
      defaultValue: ['user'],
      hasMany: true,
      options: ['super-admin', 'user'],
    },
    {
      name: 'tenants',
      type: 'array',
      fields: [
        {
          name: 'tenant',
          type: 'relationship',
          index: true,
          relationTo: 'tenants',
          required: true,
          saveToJWT: true,
        },
        {
          name: 'roles',
          type: 'select',
          defaultValue: ['tenant-viewer'],
          hasMany: true,
          options: ['tenant-admin', 'tenant-viewer'],
          required: true,
        },
      ],
      saveToJWT: true,
    },
    {
      name: 'username',
      type: 'text',
      hooks: {
        beforeValidate: [ensureUniqueUsername],
      },
      index: true,
    },
  ],
}

Successfully reproduced with another project

Link to the code that reproduces this issue

https://github.com/MrLijan/payload-report-issue (OR use the multi-tenant example)

Reproduction Steps

  • Start new project with a few collections (users, media, pages),
  • within one of the collections (pages) put an array type field that includes relationship type field
  • start app
  • try create new (page) and open array field
  • ui stuck on loading state && console throws:
"type": "Error",
      "message": "Field config not found for _pages.auth.sections.id",
      "stack":
          Error: Field config not found for _pages.auth.sections.id
              at addFieldStatePromise (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]_re_iitep6qeqia34bg4guvfwem574/node_modules/@payloadcms/ui/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js:550:15)

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

area: ui, area: core

Environment Info

Binaries:
  Node: 21.6.1
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  payload: 3.9.0
  next: 15.1.0
  @payloadcms/db-mongodb: 3.9.0
  @payloadcms/email-nodemailer: 3.9.0
  @payloadcms/graphql: 3.9.0
  @payloadcms/next/utilities: 3.9.0
  @payloadcms/payload-cloud: 3.9.0
  @payloadcms/richtext-lexical: 3.9.0
  @payloadcms/translations: 3.9.0
  @payloadcms/ui/shared: 3.9.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32712
  Available CPU cores: 12
@MrLijan MrLijan added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Dec 30, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Dec 31, 2024
@jmikrut jmikrut added status: needs-triage Possible bug which hasn't been reproduced yet prioritized labels Dec 31, 2024
@GhaythFuad
Copy link

+1, facing the same issue.

@mjaysona
Copy link

mjaysona commented Jan 2, 2025

Facing the same.

@danicaleroo
Copy link

Same issue for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prioritized status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

6 participants