loging the stack; "payload" argument must be of type object.
I am unable to register new users with my better auth/prisma NextJS app. When a user submits valid credentials, I get this error:
Ideally we would have access to log the error
.stack
, is there a way to do this ?7 Replies
this usually happens when your schema doesn't match with what better auth expects. If you haven't, use the cli to generate the schema and cross check your field with the docs.
right, that is what i have been doing. it just bit me more than a few times, and a better error would be nice (for example so i know what schema is not correct) @bekacru
but i understand how that might not be possible, some sort of onError function for the server side
The error is thrown from prisma. It's more of their issue 👀
just thinking out loud here.. When I work with prisma directly, I can get better errors by logging the error stack
This pattern is basically required to debug Prism apps. How can I configure better auth to log the error stack in these cases so I can see the necessary information
@bekacru
maybe by changing the logger? you can pass logger in your auth config
@chris add DEBUG="prisma*" to your env
i had almost the same error, first log message told me i had a env issue with my db connection string