[GH-ISSUE #3664] [SOLVED]: Method Error using Next.js 15.4.3 #9678

Closed
opened 2026-04-13 05:18:05 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @weisisheng on GitHub (Jul 28, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3664

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Not sure why this is working for others in the api route: api/auth/[...all]/route.ts

export const { GET, POST } = toNextJsHandler(auth);

Current vs. Expected behavior

#405 error raised, breaking sign-in...

Identified the Next.js 15.4.3 bug when combining methods. Modifying fixed it:

import { auth } from '@/lib/auth/auth';
import { toNextJsHandler } from 'better-auth/next-js';

const handlers = toNextJsHandler(auth);
export const GET = handlers.GET;
export const POST = handlers.POST;

What version of Better Auth are you using?

1.3.x

Provide environment information

- OS Ubuntu 24.04

Which area(s) are affected? (Select all that apply)

Client

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @weisisheng on GitHub (Jul 28, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3664 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Not sure why this is working for others in the api route: api/auth/[...all]/route.ts ```export const { GET, POST } = toNextJsHandler(auth);``` ### Current vs. Expected behavior #405 error raised, breaking sign-in... Identified the Next.js 15.4.3 bug when combining methods. Modifying fixed it: ``` import { auth } from '@/lib/auth/auth'; import { toNextJsHandler } from 'better-auth/next-js'; const handlers = toNextJsHandler(auth); export const GET = handlers.GET; export const POST = handlers.POST; ``` ### What version of Better Auth are you using? 1.3.x ### Provide environment information ```bash - OS Ubuntu 24.04 ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 05:18:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9678