[Node.js Fastify Drizzle PG] Obscure error when integrating Better-Auth

Hello, I'm testing my better-auth integration and am getting an error that is not helpful. Is there some way to get more helpful logging? I have a Node.js backend with Fastify. I've integrated Better-Auth by following the docs exactly. I am using Drizzle ORM with PG backend (hosted on Supabase). I have verified that the Fastify route is being called and that auth.handler is being called. Here is the error I get:
ERROR [Better Auth]: Error Error: NOT_FOUND
at processRequest (/Users/dinislam/Developer/bank-to-csv/node_modules/.pnpm/better-call@1.0.9/node_modules/better-call/src/router.ts:129:22)
at handler (/Users/dinislam/Developer/bank-to-csv/node_modules/.pnpm/better-call@1.0.9/node_modules/better-call/src/router.ts:200:22)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Object.<anonymous> (/Users/dinislam/Developer/bank-to-csv/apps/backend/src/lib/middleware/better-auth-plugin.ts:49:24)
ERROR [Better Auth]: Error Error: NOT_FOUND
at processRequest (/Users/dinislam/Developer/bank-to-csv/node_modules/.pnpm/better-call@1.0.9/node_modules/better-call/src/router.ts:129:22)
at handler (/Users/dinislam/Developer/bank-to-csv/node_modules/.pnpm/better-call@1.0.9/node_modules/better-call/src/router.ts:200:22)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Object.<anonymous> (/Users/dinislam/Developer/bank-to-csv/apps/backend/src/lib/middleware/better-auth-plugin.ts:49:24)
As you can see, this is not the most helpful error. Where do I go from here?
1 Reply

Did you find this page helpful?