Argument `token` is missing.
Hey, has anyone managet to get better-auth working with Prisma? i'm migrating from Authjs (next auth) to better-auth and i used the npx @better-auth/cli generate as well to create the schema and everything but i keep getting this error, even though database is completely synced and prisma client is generated:
2025-02-03T17:37:38.779Z ERROR [Better Auth]:
Invalid `db[getModelName(model)].create()` invocation in
C:\TSProjects\metal-vault\.next\server\chunks\node_modules_better-auth_dist_d8816d._.js:2667:62
2664 if (!db[getModelName(model)]) {
2665 throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$better$2d$auth$2f$dist$2f$chunk$2d$UNWCXKMP$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["BetterAuthError"](`Model ${model} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);
2666 }
→ 2667 const result = await db[getModelName(model)].create({
data: {
id: "zaQ7MgVxGF3Tjt6j4s3N3RVxccavdpG0",
identifier: "gNXa4OG7LYTggzzvjqGAzh-2XG2axCFG",
value: "{\"callbackURL\":\"/\",\"codeVerifier\":\"nYca5-cBhdZBc-JhYybXGiSifmMpR7Dd67s4gHQ7JN7XfLSH8LNz2KU-F98czk0PBLcpG3ahXekkx0Jq-MI9JM-_epnoX5rbB0FxaeeaIedeur7p-XiekEYmgTSEztnE\",\"expiresAt\":1738604858735}",
expiresAt: new Date("2025-02-03T17:47:38.735Z"),
createdAt: new Date("2025-02-03T17:37:38.735Z"),
updatedAt: new Date("2025-02-03T17:37:38.735Z"),
+ token: String
},
select: undefined
})
Argument `token` is missing.2025-02-03T17:37:38.779Z ERROR [Better Auth]:
Invalid `db[getModelName(model)].create()` invocation in
C:\TSProjects\metal-vault\.next\server\chunks\node_modules_better-auth_dist_d8816d._.js:2667:62
2664 if (!db[getModelName(model)]) {
2665 throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$better$2d$auth$2f$dist$2f$chunk$2d$UNWCXKMP$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["BetterAuthError"](`Model ${model} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);
2666 }
→ 2667 const result = await db[getModelName(model)].create({
data: {
id: "zaQ7MgVxGF3Tjt6j4s3N3RVxccavdpG0",
identifier: "gNXa4OG7LYTggzzvjqGAzh-2XG2axCFG",
value: "{\"callbackURL\":\"/\",\"codeVerifier\":\"nYca5-cBhdZBc-JhYybXGiSifmMpR7Dd67s4gHQ7JN7XfLSH8LNz2KU-F98czk0PBLcpG3ahXekkx0Jq-MI9JM-_epnoX5rbB0FxaeeaIedeur7p-XiekEYmgTSEztnE\",\"expiresAt\":1738604858735}",
expiresAt: new Date("2025-02-03T17:47:38.735Z"),
createdAt: new Date("2025-02-03T17:37:38.735Z"),
updatedAt: new Date("2025-02-03T17:37:38.735Z"),
+ token: String
},
select: undefined
})
Argument `token` is missing.