Skip to content

UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined #636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CITGuru opened this issue Sep 3, 2020 · 5 comments
Labels
help-needed The maintainer needs help due to time constraint/missing knowledge question Ask how to do something or how something works

Comments

@CITGuru
Copy link

CITGuru commented Sep 3, 2020

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

Screen Shot 2020-09-03 at 11 38 43 AM

Any help why this is happening and how to fix it.

@CITGuru CITGuru added the question Ask how to do something or how something works label Sep 3, 2020
@iaincollins iaincollins added the help-needed The maintainer needs help due to time constraint/missing knowledge label Sep 3, 2020
@iaincollins
Copy link
Member

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!

@aksperiod
Copy link

aksperiod commented Sep 7, 2020

ughhhhh I just spent a while because my file was called [...nextAuth].js

@iaincollins
Copy link
Member

@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)

@CITGuru
Copy link
Author

CITGuru commented Sep 7, 2020

@iaincollins Yh I got it fixed. Thanks.

@iaincollins
Copy link
Member

Awesome!

I've written this up as a feature request in #647 so we can help folks avoid running into this in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-needed The maintainer needs help due to time constraint/missing knowledge question Ask how to do something or how something works
Projects
None yet
Development

No branches or pull requests

3 participants