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

admin/create-first-user crashes with a user collection with a join field #10870

Closed
DanRibbens opened this issue Jan 29, 2025 · 3 comments · Fixed by #10871
Closed

admin/create-first-user crashes with a user collection with a join field #10870

DanRibbens opened this issue Jan 29, 2025 · 3 comments · Fixed by #10871

Comments

@DanRibbens
Copy link
Contributor

Describe the Bug

Having a user collection that contains a join field, the /admin/create-first-user UI will crash with the following error:

Image

TypeError: Cannot read properties of undefined (reading 'slug')
at h6 (index.js:10319:11)
at react-stack-bottom-frame (react-dom-client.development.js:23610:20)
at renderWithHooks (react-dom-client.development.js:4646:22)
at updateFunctionComponent (react-dom-client.development.js:8032:19)
at beginWork (react-dom-client.development.js:9689:18)
at runWithFiberInDEV (react-dom-client.development.js:544:16)
at performUnitOfWork (react-dom-client.development.js:15064:22)
at workLoopSync (react-dom-client.development.js:14888:41)
at renderRootSync (react-dom-client.development.js:14868:11)
at performWorkOnRoot (react-dom-client.development.js:14394:44)
at performSyncWorkOnRoot (react-dom-client.development.js:15970:7)
at flushSyncWorkAcrossRoots_impl (react-dom-client.development.js:15830:21)
at commitRootImpl (react-dom-client.development.js:15422:7)
at commitRoot (react-dom-client.development.js:15273:11)
at Object.onUnsuspend (react-dom-client.development.js:20076:11)

Link to the code that reproduces this issue

https://gist.github.com/DanRibbens/3c3974996932ea5cec59bc4ab275f4e2

Reproduction Steps

  1. pnpm dev from new database
  2. navigate to http://localhost:3000/admin
  3. crash

See error

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

area: ui

Environment Info

Binaries:
  Node: 22.6.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  payload: 3.19.0
  next: 15.1.5
  @payloadcms/db-postgres: 3.19.0
  @payloadcms/email-nodemailer: 3.19.0
  @payloadcms/graphql: 3.19.0
  @payloadcms/next/utilities: 3.19.0
  @payloadcms/payload-cloud: 3.19.0
  @payloadcms/richtext-lexical: 3.19.0
  @payloadcms/translations: 3.19.0
  @payloadcms/ui/shared: 3.19.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 32459
  Available CPU cores: 22
Copy link
Contributor

Please add a reproduction in order for us to be able to investigate.

Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.

Why was this issue marked with the invalid-reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@beta -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

Useful Resources

@DanRibbens DanRibbens added prioritized status: verified If an issue has been reproduced labels Jan 29, 2025
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Jan 29, 2025
r1tsuu added a commit that referenced this issue Jan 29, 2025
…ld (#10871)

Fixes #10870
Now we hide join fields from the `/create-first-user` view since they're
not meaningful there.
@github-actions github-actions bot removed the status: verified If an issue has been reproduced label Jan 29, 2025
Copy link
Contributor

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2025
Copy link
Contributor

github-actions bot commented Feb 5, 2025

🚀 This is included in version v3.21.0

@github-actions github-actions bot unlocked this conversation Feb 5, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant