NextAuth Error 'MISSING_NEXTAUTH_API_ROUTE_ERROR' in Next.js 13 (app route)

3.4k Views Asked by At

I'm using NextAuth version 4.22.1 with Next.js version 13.4.
I'm getting this error 'MISSING_NEXTAUTH_API_ROUTE_ERROR'. My auth provider is Auth0. I've followed all of the steps required as mentioned in the guidelines.
I've folder structure like this:
src/app/api/auth/[...nextAuth]/route.ts

Is this a bug or am I missing something?

2

There are 2 best solutions below

1
Emmanuel Kasongo Mavetya On BEST ANSWER

In my case, changing the capital letter A from [...nextAuth] in small letter like this[...nextauth] solved my problem.

0
George Larace On

The problem is most likely due to with dots in the [...nextauth] folder name which needs to be ... instead of as mentionned on this issue from the github:

https://github.com/nextauthjs/next-auth/issues/7632

It solved the problem for me.