Skip to content

Adding a custom dashboard view triggers an error in the default account view #14373

@nmcolome

Description

@nmcolome

Describe the Bug

When I add a custom dashboard view and I navigate to /admin/account I get an application error.
If I have a custom account view, and no custom dashboard view, both routes load correctly.
If I have both custom views, both load correctly.
It only happens if I have a dashboard view defined and no custom account view.

Image

Link to the code that reproduces this issue

https://github.com/nmcolome/bug-test

Reproduction Steps

  • Using payload version 3.61.1, create a blank project.
  • Run pnpm dev
  • Open in localhost and navigate to the admin dashboard. Follow the instructions to create your user, then click on the avatar to navigate to the /admin/account route to make sure everything is working correctly.
  • Stop the server.
  • Add a custom dashboard view:
// src/components/MinimalDashboard.tsx
import React from 'react'

const MinimalDashboard = () => {
  return (
    <div style={{ padding: '2rem' }}>
      <h1>Minimal Dashboard</h1>
      <p>If you can see this, the dashboard component is loading correctly.</p>
    </div>
  )
}

export default MinimalDashboard
  • Add the component to the payload.config
export default buildConfig({
  admin: {
    ...
    components: {
      views: {
        dashboard: { Component: './components/MinimalDashboard' },
      },
    },
  },
...
})
  • Run pnpm generate:importmap
  • Run pnpm dev
  • Open in localhost and navigate to the admin dashboard. Then click on the avatar to navigate to the /admin/account route. You should see a Type error that reads 'Cannot read properties of undefined (reading 'length')'

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

area: ui

Environment Info

> bug-test@1.0.0 payload /Users/nataliacolome/Documents/northshore.io/spikes/bug-test
> cross-env NODE_OPTIONS=--no-deprecation payload info

npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm.
npm warn Unknown env config "_bryntum-registry". This will stop working in the next major version of npm.

Binaries:
  Node: 23.10.0
  npm: 11.6.1
  Yarn: N/A
  pnpm: 10.19.0
Relevant Packages:
  payload: 3.61.1
  next: 15.4.4
  @payloadcms/db-mongodb: 3.61.1
  @payloadcms/email-nodemailer: 3.61.1
  @payloadcms/graphql: 3.61.1
  @payloadcms/next/utilities: 3.61.1
  @payloadcms/payload-cloud: 3.61.1
  @payloadcms/richtext-lexical: 3.61.1
  @payloadcms/translations: 3.61.1
  @payloadcms/ui/shared: 3.61.1
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
  Available memory (MB): 65536
  Available CPU cores: 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions