Rayy
Rayy•7mo ago

Getting adapter error with Next Auth and Convex in production.

My application works fine in development, and I am able to authenticate without any errors, but after deploying to vercel I get the following error
[auth][cause]: Error: [Request ID: 93a27ea7dd312e50] Server Error
at m.query (/var/task/.next/server/chunks/945.js:50:4256)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getUserByAccount (/var/task/.next/server/app/api/auth/[...nextauth]/route.js:32:1695)
at async n.<computed> (/var/task/.next/server/chunks/945.js:50:78723)
at async n3 (/var/task/.next/server/chunks/945.js:426:34371)
at async rn (/var/task/.next/server/chunks/945.js:426:45478)
at async ra (/var/task/.next/server/chunks/945.js:426:50347)
at async /var/task/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:34666
at async eS.execute (/var/task/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:25813)
at async eS.handle (/var/task/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:35920)

[auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror
[auth][cause]: Error: [Request ID: 93a27ea7dd312e50] Server Error
at m.query (/var/task/.next/server/chunks/945.js:50:4256)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getUserByAccount (/var/task/.next/server/app/api/auth/[...nextauth]/route.js:32:1695)
at async n.<computed> (/var/task/.next/server/chunks/945.js:50:78723)
at async n3 (/var/task/.next/server/chunks/945.js:426:34371)
at async rn (/var/task/.next/server/chunks/945.js:426:45478)
at async ra (/var/task/.next/server/chunks/945.js:426:50347)
at async /var/task/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:34666
at async eS.execute (/var/task/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:25813)
at async eS.handle (/var/task/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:35920)

[auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror
I have followed this (https://docs.convex.dev/production/hosting/vercel) to deploy my project and have set up the necessary environment variables, and also set up the callbacks for the specific providers, but I am yet getting this error. Can someone please help me out with this?
Using Convex with Vercel | Convex Developer Hub
Host your frontend on Vercel and your backend on Convex.
2 Replies
Michal Srb
Michal Srb•7mo ago
Can you look on your Convex dashboard what the actual error is? You can even search by the Request ID
Rayy
RayyOP•7mo ago
This is the error I am getting,
lib/adapter:getUserByAccount
failure
31ms
Uncaught Error: Adapter API called without correct secret value
at checkSecret (../../convex/lib/adapter.ts:34:2)
at input (../../convex/lib/adapter.ts:19:4)
at handler (../../node_modules/convex-helpers/dist/server/customFunctions.js:87:36)
lib/adapter:getUserByAccount
failure
31ms
Uncaught Error: Adapter API called without correct secret value
at checkSecret (../../convex/lib/adapter.ts:34:2)
at input (../../convex/lib/adapter.ts:19:4)
at handler (../../node_modules/convex-helpers/dist/server/customFunctions.js:87:36)
This is probably the function returning the error,
function checkSecret(secret: string) {
if (secret !== process.env.CONVEX_AUTH_ADAPTER_SECRET) {
throw new Error("Adapter API called without correct secret value");
}
}
function checkSecret(secret: string) {
if (secret !== process.env.CONVEX_AUTH_ADAPTER_SECRET) {
throw new Error("Adapter API called without correct secret value");
}
}
But I have checked and I am passing in my environment variables a secret key as CONVEX_AUTH_ADAPTER_SECRET Oh God, it was such a dumb error. I forgot to add my env variables in the production. 🙂

Did you find this page helpful?