Different type of errors - that's why debugging takes time and patience
I got this error, because there was a contact with no email, previously I assumed all email contacts have email:
Previously I had a situation:
- gmail account with no email (0 sent, 0 received)
- Metamask messing with popup window
Metamask opens a popup and communicates with the page - the authentication flow also opens a popup and there were some issues.
Welcome to the development world - it happens all the time!