No response from API in Next.js

I’m having trouble with the API: I added the OpenAPI plugin and tried calling the API, for example via /api/auth/reference, but I don’t get any response. The same issue occurs when I try to register a user. The requests keep loading for a long time until I eventually get an Internal Server Error. Someone else seems to have the same problem: https://github.com/better-auth/better-auth/issues/1394 route.ts in api/auth/[...all]
import { auth } from "@/lib/auth";
import { toNextJsHandler } from "better-auth/next-js";

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

export const { GET, POST } = toNextJsHandler(auth);
auth.ts
import {betterAuth} from "better-auth";
import {drizzleAdapter} from "better-auth/adapters/drizzle";
import {database} from "@/database";
import {openAPI} from "better-auth/plugins";

export const auth = betterAuth({
database: drizzleAdapter(database, {
provider: 'mysql',
}),
plugins: [
openAPI()
],
emailAndPassword: {
enabled: true,
},
})
import {betterAuth} from "better-auth";
import {drizzleAdapter} from "better-auth/adapters/drizzle";
import {database} from "@/database";
import {openAPI} from "better-auth/plugins";

export const auth = betterAuth({
database: drizzleAdapter(database, {
provider: 'mysql',
}),
plugins: [
openAPI()
],
emailAndPassword: {
enabled: true,
},
})
Has anyone ever had this problem and already has a solution?
GitHub
No Response from API in Next.js Despite Correct Payload and Headers...
Is this suited for github? Yes, this is suited for github To Reproduce Develop a NestJS backend and integrate it with BetterAuth. Set up BetterAuth in Next.js according to the documentation and con...
2 Replies
bekacru
bekacru8mo ago
can you try it from another client like postman?
maurice
mauriceOP8mo ago
I have already tried it with Postmann. But there is exactly the same problem I have found the problem... My mistake, it was due to an entry in my NextConfig that I had forgotten to remove

Did you find this page helpful?