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:
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!