Replies: 3 comments 4 replies
-
Hey @rishi-afk — this error usually means that you passed in a collection slug that does not exist. Can you double-check that your collection slug is accurate? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @jmikrut, I just double checked. The slug is mentioned correctly. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Yes I am using it in a custom route. Does the express route req object has
payload on it? Getting a type error. Should I give a type to the request
object?
…On Fri, 7 Oct 2022, 18:34 James Mikrut, ***@***.***> wrote:
OK. Then the next thing I'd check is to make sure that when you import
Payload, that it is *already initialized* before you import it / attempt
to use it.
I am willing to bet that what is happening is that when you are calling
forgotPassword, you are working with a copy of Payload that has not yet
been initialized.
One way to test / get around this is to access Payload directly from a req
- like req.payload. That ensures that it is already initialized.
Where are you calling forgotPassword from? Is it a hook, or custom route,
or elsewhere?
—
Reply to this email directly, view it on GitHub
<#1216 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFPPCFUM5W64F4CGCVJGPQTWCANXFANCNFSM6AAAAAAQ7OCYJY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When I use forgotPassword using local api payload.forgotPassword(), the app crashes and I get the following log:
2022-10-07T10:01:08.340121574Z app[web.1]: const { collection: { Model, config: collectionConfig, }, data, disableEmail, expiration, req: { payload: { config, sendEmail: email, emailOptions, }, }, req, } = args;
2022-10-07T10:01:08.340124811Z app[web.1]: ^
2022-10-07T10:01:08.340127410Z app[web.1]:
2022-10-07T10:01:08.340129584Z app[web.1]: TypeError: Cannot read properties of undefined (reading 'config')
2022-10-07T10:01:08.340131580Z app[web.1]: at forgotPassword (/usr/src/app/node_modules/payload/src/auth/operations/forgotPassword.ts:50:9)
2022-10-07T10:01:08.340146907Z app[web.1]: at runMicrotasks ()
2022-10-07T10:01:08.340149741Z app[web.1]: at processTicksAndRejections (node:internal/process/task_queues:96:5)
Any idea why it might be behaving like this?
Beta Was this translation helpful? Give feedback.
All reactions