D1 incorrect dialect
I'm trying to create an auth instance with D1 and getting an error like
My code is like:
Any suggestions?
Type 'D1Dialect' is not assignable to type 'Dialect'.The types returned by 'createDriver().acquireConnection()' are incompatible between these types.Type 'Promise<import("<my-project>/node_modules/kysely/dist/esm/driver/database-connection").DatabaseConnection>' is not assignable to type 'Promise<import("<my-project>/node_modules/better-auth/node_modules/kysely/dist/esm/driver/database-connection").DatabaseConnection>'.My code is like:
Any suggestions?
Solution
Following up if anyone encounters this in the future. Could resolve this by using older versions of
Relevant package dependencies look like:
kysely-d1 and kysely.Relevant package dependencies look like: