mailgun-js-boland
mailgun-js-boland copied to clipboard
cannot read property cache of undefined
-
What version of the module is the issue happening on? Does the issue happen on latest version? 0.20.0
-
What platform and Node.js version? (For example Node.js 6.9.1 on Mac OS X) node 8.11.4, Linux Arch
I got quite the confusing error here... reproduction code is just 2 lines, because i cant get any further with that.
const mailgun = require('mailgun-js')({
apiKey: '<api-key>',
domain: '<domain>',
});
console.log(mailgun);
I always get this error and cant get behind it.
TypeError: Cannot read property 'cache' of undefined
at Object.<anonymous> (<...>/node_modules/ftp/lib/parser.js:8:28)
It seems like mailgun-js has a dependency on proxy-agent what has a indirect dependency on ftp what throws the error. Now I dont know if this is a problem with mailgun-js or at least caused by mailgun-js. Could you help with that? Or do you have at least a hint where to look further into this? Thanks in advance
Hmm i can't seem to reproduce this. Can you check version 0.21.0.
Got the same error with v 0.22. For me it was related to the build process with webpack.
Solved it by using the webpack-node-externals
and slightly adapted webpack.config.js
:
const nodeExternals = require('webpack-node-externals');
...
externals: [nodeExternals()],
...