Trying to setup better auth
Following this guide https://www.prisma.io/docs/guides/betterauth-nextjs and using the following schema (generated):
I get:
How to use Prisma ORM and Prisma Postgres with Better-Auth and Next...
Learn how to use Prisma ORM in a Next.js app with Better-Auth
5 Replies
You selected to wait for the human sages. They'll share their wisdom soon.
Grab some tea while you wait, or check out
#ask-ai
if you'd like a quick chat with the bot anyway!You could likely easily debug this with AI.
You are creating a field
expires
then mapping it to expiresAt
which means the name of the field will be expiresAt
, which already exists.
Same with token
and sessionToken
.
The errors are right there, telling you what you're doing wrong. You could easily figure this out with AI, reading the manual, or just reading the error messages.
I'd recommend removing all/most of the @map
on properties, and simply naming your properties what you would like instead, this way is recipe for disasterI tried that then better auth didn't work so I just gave up and used clerk
it feels like a better-auth issue, but the prisma docs didn't work either
I see.
Yeah the Prisma docs can occasionally feel outdated, I've certainly experienced that a few times.
I have personally not had any issues with BetterAuth and have implemented it succesfully in a few apps, and I don't recall anything around the database schema being an issue
Sorry I can't be of more specific help for the time being
No worries, I was also baffled, since I've done the setup quite a few times but this time it just didn't work