2025-04-09T13:12:33.351Z ERROR [Better Auth]: INTERNAL_SERVER_ERROR [AggregateError: ]

I'm getting this error:
2025-04-09T13:12:33.351Z ERROR [Better Auth]: INTERNAL_SERVER_ERROR [AggregateError: ] { code: 'ETIMEDOUT' }
2025-04-09T13:12:33.351Z ERROR [Better Auth]: INTERNAL_SERVER_ERROR [AggregateError: ] { code: 'ETIMEDOUT' }
I've followed the introduction to set it up. I'm getting when trying to login anonymously
10 Replies
Ping
Ping2w ago
Can you show me your auth config, as well as tell me what framework you're using?
Anay-208
Anay-208OP2w ago
Nextjs I'll share config -# auth/index.ts
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { db } from "@/db";
import { anonymous } from "better-auth/plugins"

export const auth = betterAuth({
emailAndPassword: {
enabled: true
},
// TODO: Social Providers
database: drizzleAdapter(db, {
provider: "pg",
}),
plugins: [anonymous()]
});
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { db } from "@/db";
import { anonymous } from "better-auth/plugins"

export const auth = betterAuth({
emailAndPassword: {
enabled: true
},
// TODO: Social Providers
database: drizzleAdapter(db, {
provider: "pg",
}),
plugins: [anonymous()]
});
-# auth/client.ts
import { createAuthClient } from "better-auth/client"
import { anonymousClient } from "better-auth/client/plugins"

export const authClient = createAuthClient({
plugins: [
anonymousClient()
]
})
import { createAuthClient } from "better-auth/client"
import { anonymousClient } from "better-auth/client/plugins"

export const authClient = createAuthClient({
plugins: [
anonymousClient()
]
})
-# app/api/auth/[...all]/route.ts
import { auth } from "@/auth";
import { toNextJsHandler } from "better-auth/next-js";

export const { POST, GET } = toNextJsHandler(auth);
import { auth } from "@/auth";
import { toNextJsHandler } from "better-auth/next-js";

export const { POST, GET } = toNextJsHandler(auth);
If you want github repo: https://github.com/anay-208/nextjs-hackathon
Anay-208
Anay-208OP2w ago
same error when attempting to get session
No description
Anay-208
Anay-208OP2w ago
I'm on windows with wsl if it could cause it For some reason, it works fine with github codespaces, why is that Someone also in my team is getting the same error
Ping
Ping2w ago
Not too sure.. Are they using wsl as well?
Anay-208
Anay-208OP2w ago
Yes In gihub codespaces I don't get this error
Ping
Ping2w ago
I haven't seen this error as well, I do wonder if it could relate to that. We do have unit tests for things like the anonymous plugin, and these all work fine for us.
Anay-208
Anay-208OP6d ago
maybe you can try to replicate it in wsl?
bekacru
bekacru6d ago
is it only when you try to login anonymously?
Anay-208
Anay-208OP5d ago
I m only using anonymous login and nothing else

Did you find this page helpful?