papnkukn / eml-format

RFC 822 EML file format parser and builder
MIT License
88 stars 53 forks source link

TypeError: Cannot read property 'Date' of undefined #13

Closed ghost closed 4 years ago

ghost commented 5 years ago

Hello,

I just download the last version, ran the example using a eml file and returns this error:

TypeError: Cannot read property 'Date' of undefined at _read (/servidor_html/eurosisnergia-norte.com/s/node_modules/eml-format/lib/eml-format.js:374:23) at Object.emlformat.read (/servidor_html/eurosisnergia-norte.com/s/node_modules/eml-format/lib/eml-format.js:522:5)

papnkukn commented 4 years ago

Hmm, the parser returns an empty object somehow. Can you provide an example of EML file?

ghost commented 4 years ago

Sorry, i cannot. This was months ago. I do not know which emailwas anymore.

jaydevelopsstuff commented 3 years ago

The reason I had this problem was because I was using fs.readFileSync's buffer output without converting it to a string. So I took that output from fs and invoked .toString and that fixed my problem. Hope this helps!