Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[v4 beta] Hierarchy collection won't load when its title field is inside tabs

Open
#18,816 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@goransh-walia is already working on this.

Since Oct 17, 2026.

  • #18817 by @goransh-walia — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
mongodb, typescript
Domain
backend

Research direction

Start with packages/payload/src/hierarchy/utils/findUseAsTitle.ts, especially the tab and nested-field lookup around lines 70–87. Use src/collections/Sections.ts from the linked reproduction and run REPRO_TITLE_IN_TABS=1 pnpm dev or pnpm repro:title-in-tabs to confirm the failure. Done means a hierarchy title inside an unnamed tab, row, collapsible, or group is found without nonmatching nested containers throwing; note that linked pull request #18817 is already open.

Written by the indexing model from the issue text.

Description

area: core Bug created-by: Contributor
Describe the Bug

What you see: with this collection in the config, the whole admin and API fail with:

Error: The hierarchy title field "name" was not found. It cannot be nested within named fields i.e. named groups, named tabs, etc.

The hierarchy title field "name" was not found

export const Sections: CollectionConfig = {
  slug: 'sections',
  admin: { useAsTitle: 'name' },
  hierarchy: { parentFieldName: 'parent' },
  fields: [
    {
      type: 'tabs',
      tabs: [
        { label: 'General', fields: [{ name: 'name', type: 'text', required: true }] },
        { label: 'Details', fields: [{ name: 'description', type: 'textarea' }] },
      ],
    },
  ],
}

Expected: it loads. name is in an unnamed tab, which the error message itself says is allowed. It fails in either tab (putting General last gives the same error), and only loads once name is moved out of the tabs.

Why: hierarchy/utils/findUseAsTitle.ts searches every tab. Searching a tab that doesn't contain the field throws (L87) instead of returning nothing, so whichever tab doesn't hold name throws, even when another tab has a match. An unnamed row, collapsible or group without the field throws the same way.

Link to the code that reproduces this issue

https://github.com/AaronClaes/payload-v4-hierarchy-repro

Reproduction Steps

Needs a local MongoDB. The Sections collection above is in src/collections/Sections.ts, and is only added to the config when REPRO_TITLE_IN_TABS=1.

  1. Clone the repo, then run cp .env.example .env and pnpm install.
  2. Run REPRO_TITLE_IN_TABS=1 pnpm dev and open /admin. The error above shows.

pnpm repro:title-in-tabs shows the same error without starting the admin.

Which area(s) are affected?

area: core

Environment Info
Binaries:
  Node: 24.15.0
  pnpm: 10.17.1
Relevant Packages:
  payload: 4.0.0-beta.2
  next: 16.4.2
  @payloadcms/db-mongodb: 4.0.0-beta.2
  @payloadcms/ui: 4.0.0-beta.2
  react: 19.3.1
  react-dom: 19.3.1
Database: MongoDB 8.3.7
Operating System:
  Platform: darwin (arm64)
Dominant language
TypeScript
Stars
45.5k
Forks
4.3k
Avg merge
1d 19h
Merged PRs (30d)
309

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from payloadcms/payload

All issues in payloadcms/payload

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.