payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
23.33k stars 1.48k forks source link

Forgot password route crashes #8185

Closed hristokoev closed 1 day ago

hristokoev commented 5 days ago

Link to reproduction

No response

Environment Info

Payload: beta.104
Node.js: 22.8.0
Next.js: 15.0.0-canary.104

Describe the Bug

When trying to access the /admin/forgot route, I get the following error:

Unhandled Runtime Error
Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.
  <... elements={{...}} i18nKey=... t={function t}>
                                      ^^^^^^^^^^^^

Full error in the console:

 ⨯ Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.
  <... elements={{...}} i18nKey=... t={function t}>
                                      ^^^^^^^^^^^^
    at stringify (<anonymous>)
    at stringify (<anonymous>)
    at stringify (<anonymous>)
    at AsyncResource.runInAsyncScope (node:async_hooks:211:14)
digest: "3967774931"
 GET /admin/forgot 500 in 254ms

Reproduction Steps

Simply install the latest beta version (beta.104) and go to /admin/forgot.

I believe this started around beta.98, because I have another project with beta.97 and the route there works It works only in production, but in dev it's still there.

Adapters and Plugins

No response

paulpopus commented 4 days ago

I couldn't reproduce this on the latest beta. Do you have any custom components by any chance that could affect this page?

hristokoev commented 4 days ago

I've used the following command:

npx create-payload-app@beta my-project

Then I selected the blank template and installed. Upon running, I had to create a user, then I logged in and tried the route /admin/forgot, which resulted in the same crash, though it showed a different error on the frontend (in terminal the error is still the same as written above). There are no customisations, custom components, new fields, new collections or anything whatsoever. I'm using the Payload's blank template as-is.

image

paulpopus commented 4 days ago

Ok I can replicate this error but not the other initial one, thanks!

paulpopus commented 1 day ago

This will be fixed in https://github.com/payloadcms/payload/pull/8244

Thanks again

github-actions[bot] commented 6 hours ago

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