Next-auth: Getting "Cannot save, given value must be instance of entity class, instead object literal is given. Or you must specify an entity target to method call."

Created on 28 Jul 2020  路  2Comments  路  Source: nextauthjs/next-auth

Describe the bug
I'm using the Email provider and when I'm trying to log in using an email provided, I'm getting Cannot save, given value must be instance of entity class, instead object literal is given. Or you must specify an entity target to method call.

Link to my nextauth.ts file.

To Reproduce
Try to log in using Email on production and you'll get this error. I'm using the following:

  1. Heroku for hosting Hasura app
  2. Vercle for hosting Next.js app

Expected behavior
The user should be able to log in and no error should appear.

Screenshots or error logs
Screenshot 2020-07-28 at 9 42 58 AM

Additional context
Using the Email provider, if you do the following, you'll also get the error:

  1. Log in using an email
  2. Log out
  3. Log in using the same email again
  • [ ] Found the documentation helpful
  • [ ] Found documentation but was incomplete
  • [x] Could not find relevant documentation
  • [ ] Found the example project helpful
  • [ ] Did not find the example project helpful
bug

Most helpful comment

Thanks for reporting this issue! This is quite a Yikes! bug introduced in refactoring.

Have released a hotfix as 3.0.1 that resolves it.

All 2 comments

I can confirm I'm also seeing this issue and will need a hotfix.

Thanks for reporting this issue! This is quite a Yikes! bug introduced in refactoring.

Have released a hotfix as 3.0.1 that resolves it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iaincollins picture iaincollins  路  3Comments

iaincollins picture iaincollins  路  3Comments

SharadKumar picture SharadKumar  路  3Comments

bscaspar picture bscaspar  路  3Comments

Xetera picture Xetera  路  3Comments