Skip to content

Client fetch error when deploying via Vercel but NEXTAUTH_URL seems correct #7299

Closed Answered by dextermb
dextermb asked this question in Help
Discussion options

You must be logged in to vote

This was an interesting one. I had my API related utils (such as middleware, endpoint helpers, etc) under /api and obviously had the API endpoints under /pages/api.

Seems like any endpoints that were defined such as my /pages/api/health (and test endpoint /pages/api/auth/test) worked as expected, but /pages/api/auth/[...nextauth].ts were not getting picked up when on Vercel.

I've moved my API utils into /utils/api and now it seems to work as expected.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dextermb
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants