DEV Community

Discussion on: How to build a simple login with Nextjs? (and react hooks)

Collapse
 
shanegray394 profile image
Shane Dalton Gray

I'm getting this error. Any idea why?

TypeError: Cannot read properties of undefined (reading 'length')
63 | // proceed to Create
64 | createUser(db, email, password, function (creationResult) {

65 | if (creationResult.ops.length === 1) {
| ^
66 | const user = creationResult.ops[0];
67 | const token = jwt.sign(
68 | { userId: user.userId, email: user.email },