Next.js Discord

Discord Forum

Getting 405 when using alias export in route file

Unanswered
Riday 💙 posted this in #help-forum
Open in Discord
Say, I have a function
// @/auth/google
export async function googleCallback(req: NextRequest) {
  // This function connects to MongoDB, sets cookies() ultimately returns a redirect();
}

And I am re-exporting it from a route file:
// route.ts
export { googleCallback as GET } from '@/auth/google';

I keep getting 405 METHOD NOT ALLOWED with turbo. Though this seems to work fine without turbo (with SWC). Is this invalid syntax or something? or a bug?

1 Reply

Additional info:
- Using pnpm
- Next 14.1.2 (App dir)