I am trying to setup Next Auth with MongoDB and I have everything set up, but I keep getting the errors below when I tried to visit the sign-in page or page auth pages:
UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined

Any help why this is happening and how to fix it.
Hi there!
Do you have a file called [...nextauth].js in pages/api/auth?
I suspect not that is causing the error (maybe it's called something else?)
We could definitely handle this error better!
ughhhhh I just spent a while because my file was called [...nextAuth].js
@aksperiod Ugh! Thanks for the feedback. That sounds like something we should catch, especially if multiple folks are running into it. Would be good to leave this open until there is PR or a ticket to capture the work to resolve it.
(e.g. display error / warning on console)
@iaincollins Yh I got it fixed. Thanks.
Awesome!
I've written this up as a feature request in #647 so we can help folks avoid running into this in future.
Most helpful comment
ughhhhh I just spent a while because my file was called
[...nextAuth].js