{"record":{"id":"01c856a9d96ba170","repo":"overleaf/overleaf","slug":"invalid-email-01c856","errorCode":null,"errorMessage":"invalid_email","messagePattern":"invalid_email","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"services/web/app/src/Features/Collaborators/CollaboratorsInviteController.mjs","lineNumber":144,"sourceCode":"  } else {\n    allowed = await LimitationsManager.promises.canAddXEditCollaborators(\n      projectId,\n      1\n    )\n  }\n\n  if (!allowed) {\n    logger.debug(\n      { projectId, email, sendingUserId },\n      'not allowed to invite more users to project'\n    )\n    return res.json({ invite: null })\n  }\n\n  email = EmailHelper.parseEmail(email, true)\n  if (email == null || email === '') {\n    logger.debug({ projectId, email, sendingUserId }, 'invalid email address')\n    return res.status(400).json({ errorReason: 'invalid_email' })\n  }\n\n  const underRateLimit =\n    await CollaboratorsInviteController._checkRateLimit(sendingUserId)\n  if (!underRateLimit) {\n    return res.sendStatus(429)\n  }\n\n  const shouldAllowInvite =\n    await CollaboratorsInviteController._checkShouldInviteEmail(email)\n  if (!shouldAllowInvite) {\n    logger.debug(\n      { email, projectId, sendingUserId },\n      'not allowed to send an invite to this email address'\n    )\n    return res.json({\n      invite: null,\n      error: 'cannot_invite_non_user',","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/overleaf/overleaf/blob/28ad3b03b71cb4311decdcb55c36b33ec10d72db/services/web/app/src/Features/Collaborators/CollaboratorsInviteController.mjs#L126-L162","documentation":"Validation branch in inviteToProject: EmailHelper.parseEmail returned null/empty for the submitted invite email address, so the invite request is rejected with 400 and errorReason 'invalid_email' before any invite is created.","triggerScenarios":"Thrown at services/web/app/src/Features/Collaborators/CollaboratorsInviteController.mjs:144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the email address syntax and resubmit","Trim/clean the input before sending the request"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"28ad3b03b71cb4311decdcb55c36b33ec10d72db","analyzedAt":"2026-09-03T02:10:22.807Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}