NextAuth 出现错误 ‘MISSING_NEXTAUTH_API_ROUTE_ERROR’ 在 Next.js 13 (应用路由) 中。

huangapple go评论66阅读模式
英文:

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?

英文:

I'm using NextAuth version 4.22.1 with Next.js version 13.4.
<br>
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.
<br>
I've folder structure like this:<br>
src/app/api/auth/[...nextAuth]/route.ts
<br>
<br>
Is this a bug or am I missing something?

答案1

得分: 6

问题很可能是由于[...nextauth]文件夹名称中的点号,它需要是...而不是GitHub上的问题中提到的

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

这解决了我的问题。

英文:

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.

答案2

得分: 4

在我的情况下,将大写字母A从[...nextAuth]更改为小写字母,就像这样[...nextauth]解决了我的问题。

英文:

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

huangapple
  • 本文由 发表于 2023年5月21日 21:39:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76300196.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定