Next.js Discord

Discord Forum

Reguarding deploying next js project on vercel

Answered
zomb posted this in #help-forum
Open in Discord
Avatar
https://github.com/hemanthhhhhh/food-website

This is my project code.. I was trying to upload it on vercel but I'm facing an error.. Please help me resolve this
Image
Answered by Yi Lon Ma
create new file, export authOptions from that file and import into this file and pass into NextAuth
View full answer

8 Replies

Avatar
English Angora
is your error only happening on deployment?
Avatar
Asian black bear
The error is very clear. You are not allowed to export authOptions from that route handler file
Image
Avatar
the error is quite clear. You are exporting authOptions from that route which isn't supported so move that export to another file and just export http verbs from the route.js file
Avatar
Yea, it's running fine on localhost
Avatar
English Angora
Near and Orm answered you, they know far more then me about next.js
Avatar
Can you please clarify and tell where to make changes in the code or just create a new file @Yi Lon Ma @Asian black bear
Avatar
create new file, export authOptions from that file and import into this file and pass into NextAuth
Answer
Avatar
Ok thank you