DrizzleThe model "verification" was not found in the schema object. Please pass the schema

I just followed the installation + sveltekit guide. Clicking the login action gives me a 500 on http://localhost:5173/api/auth/sign-in/social Server error is ERROR [Better Auth]: BetterAuthError [BetterAuthError: [# Drizzle Adapter]: The model "verification" was not found in the schema object. Please pass the schema directly to the adapter options.] { cause: undefined } the tables exist i can query them too.
9 tables
account 13 columns 0 indexes 1 fks
appointment 8 columns 0 indexes 3 fks
customer 8 columns 0 indexes 0 fks
employee 2 columns 0 indexes 0 fks
service 3 columns 0 indexes 0 fks
session 8 columns 1 indexes 1 fks
shiftPlan 18 columns 0 indexes 1 fks
user 7 columns 1 indexes 0 fks
verification 6 columns 0 indexes 0 fks
9 tables
account 13 columns 0 indexes 1 fks
appointment 8 columns 0 indexes 3 fks
customer 8 columns 0 indexes 0 fks
employee 2 columns 0 indexes 0 fks
service 3 columns 0 indexes 0 fks
session 8 columns 1 indexes 1 fks
shiftPlan 18 columns 0 indexes 1 fks
user 7 columns 1 indexes 0 fks
verification 6 columns 0 indexes 0 fks
my hooks.server.ts
const originalHandle: Handle = async ({ event, resolve }) => {
const locale = languageTag();
dayjs.locale(locale);
const response = await resolve(event);
return response;
};

const authHandle: Handle = async ({ event, resolve }) => {
return svelteKitHandler({ event, resolve, auth });
};

const handleParaglide: Handle = i18n.handle();

export const handle = sequence(authHandle, handleParaglide, originalHandle);
const originalHandle: Handle = async ({ event, resolve }) => {
const locale = languageTag();
dayjs.locale(locale);
const response = await resolve(event);
return response;
};

const authHandle: Handle = async ({ event, resolve }) => {
return svelteKitHandler({ event, resolve, auth });
};

const handleParaglide: Handle = i18n.handle();

export const handle = sequence(authHandle, handleParaglide, originalHandle);
now it asks me to pass the schema. but drizzle schemas are usually just exported tables. theres no default export or what am i missing?
Solution:
okay well import * as schema from '$lib/server/db/schema'; was actually enough to fix it. im still a bit confused about the error. i dont think i made any changes to the very default setup...
Jump to solution
1 Reply
Solution
Silvan
Silvan3d ago
okay well import * as schema from '$lib/server/db/schema'; was actually enough to fix it. im still a bit confused about the error. i dont think i made any changes to the very default setup

Did you find this page helpful?