v1.2.6, v.1.2.7, and v1.2.8 throws errors when logging in

Upgrading better-auth to v1.2.6 (using D1Dialect / Cloudflare D1 via kysely-d1) against a verification table where expires_at is a TIMESTAMP/text column throws:
Oops!
Field expires_at not found in model verification
Oops!
Field expires_at not found in model verification
On v1.2.7 it then errors with:
Oops!
D1_TYPE_ERROR: Type 'object' not supported for value 'Sun Apr 27 2025 21:02:32 GMT+0800 (Malaysia Time)'
Oops!
D1_TYPE_ERROR: Type 'object' not supported for value 'Sun Apr 27 2025 21:02:32 GMT+0800 (Malaysia Time)'
Reverting to ≤1.2.5 fixes it. Anyone run into this? Also, unrelated but can we add a React Router V7 tag as Remix was replaced by that?
12 Replies
Ping
Ping5mo ago
Can I see your auth config rq?
Kenny
KennyOP5mo ago
Ping
Ping5mo ago
Hey, I'm not 100% sure this will fix your issue. But I've opened a PR which would make Kysely adapter choose "safer" options when it comes to whether a given DB type supports Dates and other fields. https://github.com/better-auth/better-auth/pull/2478
Kenny
KennyOP4mo ago
Same error unfortunately: D1_TYPE_ERROR: Type 'object' not supported for value 'Tue Apr 29 2025 22:26:24 GMT+0800 (Malaysia Time)' bump
Oops!
Cannot read properties of undefined (reading 'message')
...
Oops!
Cannot read properties of undefined (reading 'message')
...
This is as of v1.2.8 bump @Ping any chance you could revisit this?
Ping
Ping4mo ago
Does it include a callstack?
Kenny
KennyOP4mo ago
I'll grab that for you. Which version would you like me to run? 1.2.6, 1.2.7, or 1.2.8?
Ping
Ping4mo ago
Latest
Kenny
KennyOP4mo ago
Oops!
Cannot read properties of undefined (reading 'message')

TypeError: Cannot read properties of undefined (reading 'message')
at action (/[REDACTED]/app/routes/auth.verify-otp.tsx:91:17)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at /[REDACTED]/node_modules/react-router-devtools/dist/context.js?v=caaa5706:126:15
at /[REDACTED]/node_modules/react-router-devtools/dist/server.js?v=caaa5706:340:17
at callRouteHandler (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:10233:16)
at file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:4133:19
at callLoaderOrAction (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:4185:16)
at async Promise.all (index 0)
at defaultDataStrategy (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:3848:17)
at callDataStrategyImpl (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:4084:17)
at callDataStrategy (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:3218:19)
at submit (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:3025:21)
at queryImpl (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:2960:23)
at Object.query (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:2834:18)
at singleFetchAction (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:10538:18)
at handleSingleFetchRequest (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:11004:45)
at requestHandler (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:10880:18)
at /[REDACTED]/node_modules/@react-router/dev/dist/vite/cloudflare.js:860:25
Oops!
Cannot read properties of undefined (reading 'message')

TypeError: Cannot read properties of undefined (reading 'message')
at action (/[REDACTED]/app/routes/auth.verify-otp.tsx:91:17)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at /[REDACTED]/node_modules/react-router-devtools/dist/context.js?v=caaa5706:126:15
at /[REDACTED]/node_modules/react-router-devtools/dist/server.js?v=caaa5706:340:17
at callRouteHandler (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:10233:16)
at file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:4133:19
at callLoaderOrAction (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:4185:16)
at async Promise.all (index 0)
at defaultDataStrategy (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:3848:17)
at callDataStrategyImpl (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:4084:17)
at callDataStrategy (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:3218:19)
at submit (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:3025:21)
at queryImpl (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:2960:23)
at Object.query (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:2834:18)
at singleFetchAction (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:10538:18)
at handleSingleFetchRequest (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:11004:45)
at requestHandler (file:///[REDACTED]/node_modules/react-router/dist/development/chunk-D4RADZKF.mjs:10880:18)
at /[REDACTED]/node_modules/@react-router/dev/dist/vite/cloudflare.js:860:25
Ping
Ping4mo ago
Can you show me your code in auth,verify-otp.tsx?
Kenny
KennyOP4mo ago
Kenny
KennyOP4mo ago
I can invite you to the entire repo as well. I'm planning to open source it in the future anyways
Ping
Ping4mo ago
Yeah that would be great, thanks

Did you find this page helpful?