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

TypeError: Cannot read properties of undefined (reading 'confirm-reindex-modal') #10042

Open
cbratschi opened this issue Dec 18, 2024 · 3 comments
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@cbratschi
Copy link

Describe the Bug

Error while opening the search collection in the admin panel:

Error: Cannot read properties of undefined (reading 'confirm-reindex-modal') 3351752589
Request: /admin/collections/search?limit=10 GET
Context: App Router /admin/[[...segments]] render server-rendering undefined
Runtime: nodejs
 ⨯ [TypeError: Cannot read properties of undefined (reading 'confirm-reindex-modal')] {
  digest: '3351752589'
}

Happens while server-rendering this component.

Unfortunately not much details in the stack trace:

The above error occurred in the <eval> component. It was handled by the <ReactDevOverlay> error boundary. Error Component Stack
    at eval (index.js:3157:17)
    at ReindexConfirmModal (index.js:14:3)
    at div (<anonymous>)
    at ReindexButtonClient (index.client.js:27:34)

Link to the code that reproduces this issue

https://github.com/cbratschi/payload

Reproduction Steps

Use the search plugin. Open the search collection admin page. Error occurs while loading.

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

plugin: search

Environment Info

Binaries:
  Node: 22.9.0
  npm: 10.8.3
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  payload: 3.6.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031
  Available memory (MB): 65536
  Available CPU cores: 16
@cbratschi cbratschi added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Dec 18, 2024
@akhrarovsaid
Copy link
Contributor

Hey @cbratschi, I'll look into this one too. Strange as your error message seems to be about the reindex modal slug passed to the modal hook. I did not notice this error in 3.6.0, but maybe try latest in the meantime?

@akhrarovsaid
Copy link
Contributor

Hey @cbratschi,

Just following up on this as promised! I can't reproduce this issue and haven't seen an instance of it since reindexing was introduced. As I mentioned above, the error you're seeing is related to the slug of the reindex modal so I'm thinking it might have something to do with the ui package modals. My recommendation would be to update to the latest or try reinstalling deps.

I tested against the monorepo using both mongodb and postgres. If you're still seeing this issue, then it'd be nice if I could see a valid repro or some more details about your environment.

@EmmanuelAjibokun
Copy link

Hello @akhrarovsaid,

Please can you share how you were able to run through the issue, and how you arrived at your solution. I am new to open-source contribution, and I found out about this issue on Tublian.
Can you please enlighten me in anyway, I am willing to learn.

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

No branches or pull requests

3 participants