Next.js Discord

Discord Forum

Reaguarding next auth error

Answered
zomb posted this in #help-forum
Open in Discord
Avatar
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
Image
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
Avatar
I have done it too.. See my utils folder.. I have exported it from there and imported inside api/auth/[...nextauth]/route page
Avatar
@Ray move your authConfigs to other file and export it from there instead of exporting it inside `route.js`
Avatar
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
Avatar
still got error?
what is the error now?
Avatar
Yea actually the same error is occuring again
Avatar
@zomb No change
Avatar
delete the project from vercel and create it again
Avatar
Image
Image
Avatar
@Yi Lon Ma delete the project from vercel and create it again
Avatar
This is the new error now... There is no end to it 💀
Avatar
@zomb This is the new error now... There is no end to it 💀
Avatar
you didn't fix the imports of authOptions
the errors are clear, fix them
Avatar
Image
Image
Image
Created a new file, exported authoptions from there and imported in the auth/[... nextauth]/route
Avatar
Image
Now this 🙂
Avatar
@Yi Lon Ma you also need to fix these imports as well
Avatar
How to fix this any idea?
Avatar
@zomb How to fix this any idea?
Avatar
https://github.com/vercel/next.js/discussions/33051
literally the first google search result
Avatar
@zomb How to fix this any idea?
Avatar
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'
Avatar
Thankyou for the help it's solved 🎉🎆