Skip to content

Cannot read properties of undefined (reading 'has') at simple-parser.js:90:30 #346

@RomansBermans

Description

@RomansBermans

Hi everyone,

I am hitting a condition which doesn't propagate an error from simple-parser.js, so my try / catch is not able to catch the error and I can't handle the failure logic. Basically in my code I have:

try {
  const parsed = await simpleParser(emailBuffer)
  handleParsed(parsed)
} catch (error) {
  handleError(error)
}

The handleError(error) is never called, I can only see the following error in the console (which comes from the mailparser library):

Screenshot 2023-06-27 at 19 25 37

if (mail.headers.has(key)) {

Anyone has got any ideas what to do? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions