Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot read property cache of undefined #219

Open
EliArtist opened this issue Sep 3, 2018 · 2 comments
Open

cannot read property cache of undefined #219

EliArtist opened this issue Sep 3, 2018 · 2 comments
Assignees

Comments

@EliArtist
Copy link

EliArtist commented Sep 3, 2018

  1. What version of the module is the issue happening on? Does the issue happen on latest version?
    0.20.0

  2. 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

@bojand bojand self-assigned this Sep 11, 2018
@bojand
Copy link
Collaborator

bojand commented Sep 18, 2018

Hmm i can't seem to reproduce this. Can you check version 0.21.0.

@MainAero
Copy link

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()],
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants