Skip to content

initPageResult is undefined in custom dashboard component #12151

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

Open
linobino1 opened this issue Apr 17, 2025 · 0 comments
Open

initPageResult is undefined in custom dashboard component #12151

linobino1 opened this issue Apr 17, 2025 · 0 comments
Labels
created-by: Contributor status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@linobino1
Copy link
Contributor

Describe the Bug

// payload.config.ts
export default buildConfig({
  admin: {
    components: {
      views: {
        dashboard: { Component: './Dashboard' },
      },
    },
  }
  // ...
})
// Dashboard.tsx
                                       undefined
                                          v
export default function Dashboard({ initPageResult }: AdminViewServerProps) {
  return <div>Dashboard</div>
}

I would expect initPageResult to be defined, like it usually is in other custom components.

Link to the code that reproduces this issue

https://github.com/linobino1/mvce-init-page-result

Reproduction Steps

git clone https://github.com/linobino1/mvce-init-page-result
cd mvce-init-page-result

pnpm i
pnpm dev

# visit http://localhost:3000/admin

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

area: ui

### Environment Info

```text
Binaries:
  Node: 23.7.0
  npm: 11.1.0
  Yarn: N/A
  pnpm: 10.7.0
Relevant Packages:
  payload: 3.33.0
  next: 15.3.0
  @payloadcms/db-mongodb: 3.33.0
  @payloadcms/email-nodemailer: 3.33.0
  @payloadcms/graphql: 3.33.0
  @payloadcms/next/utilities: 3.33.0
  @payloadcms/payload-cloud: 3.33.0
  @payloadcms/richtext-lexical: 3.33.0
  @payloadcms/translations: 3.33.0
  @payloadcms/ui/shared: 3.33.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8
@linobino1 linobino1 added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. labels Apr 17, 2025
@github-actions github-actions bot added created-by: Contributor and removed validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. labels Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Contributor status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant