Reaguarding next auth error
Answered
zomb posted this in #help-forum
zombOP
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
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
24 Replies
@zomb 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
move your authConfigs to other file and export it from there instead of exporting it inside
route.js
Answer
zombOP
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`
zombOP
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?
@zomb 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
The screeshot is exactly same to what you posted a day earlier, did you actually redeploy?
zombOP
Yea actually the same error is occuring again
@zomb No change
delete the project from vercel and create it again
zombOP
@Yi Lon Ma delete the project from vercel and create it again
zombOP
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
zombOP
Created a new file, exported authoptions from there and imported in the auth/[... nextauth]/route
zombOP
Now this 🙂
@Yi Lon Ma you also need to fix these imports as well
zombOP
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
literally the first google search result
@zomb How to fix this any idea?
You are using path alias to import
move
and change
clientPromise
in authConfigmove
utils
folder inside src
and change
import {User} from '../src/models/User'
to import {User} from '@/models/User'
@Ray 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'`
also, fix the import path in api/auth/[...nextauth]/route after you move
utils
folderzombOP
Thankyou for the help it's solved 🎉🎆