nodemailer / mailparser

Decode mime formatted e-mails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: __webpack_require__.i(...) is not a function

Oussama-Abderrahim opened this issue · comments

This error occurs when importing mailparser inside an ElectronJs based app.

Upon research, I found out this was an issue with the iconv-lite library (specifically with Electron), refer to this this discussion around this same issue.

This was fixed starting from iconv-lite v^6.0.0, yet the problem persists because of the libmime dependency (which is still using iconv-lite v0.5.0).

Here is the error code to confirm :

Uncaught TypeError: __webpack_require__(...) is not a function
    at eval (webpack-internal:///./node_modules/mailparser/node_modules/libmime/node_modules/iconv-lite/lib/index.js:144)
    at Object../node_modules/mailparser/node_modules/libmime/node_modules/iconv-lite/lib/index.js

Bumping iconv-lite version manually (inside node_modules/mailparser/node_modules/libmime/package.json) seemed to fix the issue.

Except having the libmime developper updating the package, is there anyway to make this fix automated for future npm installs?

Thank you

Should be fixed in 2.8.0