Next.js Discord

Discord Forum

Reaguarding next auth error

Answered
zomb posted this in #help-forum
Open in Discord
Please can anyone help me in this.. Tried updating the code ample of times but still no improvements... Can anyone try to clone this from code and deploy it and tell the issue I would be glad...

My project code
https://github.com/hemanthhhhhh/food-website
Answered by Ray
move your authConfigs to other file and export it from there instead of exporting it inside route.js
View full answer

24 Replies

Answer
I have done it too.. See my utils folder.. I have exported it from there and imported inside api/auth/[...nextauth]/route page
@Ray move your authConfigs to other file and export it from there instead of exporting it inside `route.js`
Can you please make a pull request or like show me exactly inside my github where to make the necessary changes and what to do.. Have been struggling for 2 days with this error
still got error?
what is the error now?
Yea actually the same error is occuring again
@zomb No change
delete the project from vercel and create it again
@@ts-ignore delete the project from vercel and create it again
This is the new error now... There is no end to it 💀
@zomb This is the new error now... There is no end to it 💀
you didn't fix the imports of authOptions
the errors are clear, fix them
Created a new file, exported authoptions from there and imported in the auth/[... nextauth]/route
@zomb Created a new file, exported authoptions from there and imported in the auth/[... nextauth]/route
you also need to fix these imports as well
Now this 🙂
@@ts-ignore you also need to fix these imports as well
How to fix this any idea?
@zomb How to fix this any idea?
https://github.com/vercel/next.js/discussions/33051
literally the first google search result
@zomb How to fix this any idea?
You are using path alias to import clientPromise in authConfig
move utils folder inside src
and change import {User} from '../src/models/User' to import {User} from '@/models/User'
Thankyou for the help it's solved 🎉🎆