next.jsnext-authnext.js13app-route

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


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?


Solution

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