Cannot read properties of undefined (reading 'findOneAndUpdate')
nidzammst opened this issue · comments
MongoDB connection already established
⨯ lib/actions/user.actions.ts (44:11) @ updateUser
⨯ Error: Failed to create/update user: Cannot read properties of undefined (reading 'findOneAndUpdate')
at updateUser (./lib/actions/user.actions.ts:38:19)
42 | }
43 | } catch (error: any) {
44 | throw new Error(
Failed to create/update user: ${error.message}
);
| ^
45 | }
46 | }
47 | }
There was something wrong with the AccountProfile.tsx file. I changed it by copying the code from the repository and now the error has resolved