You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read property 'params' of undefined
at impl (/.../node_modules/mailgun-js/lib/build.js:42:16)
at callback (/.../node_modules/promisify-call/index.js:32:8)
at /.../node_modules/with-callback/index.js:39:7
at new Promise ()
at withCallback (/.../node_modules/with-callback/index.js:5:10)
at promisifyCall (/.../node_modules/promisify-call/index.js:28:10)
at promisifed (/.../node_modules/mailgun-js/lib/build.js:105:14)
at post (/.../src/handlers.js:39:3)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
What version of the module is the issue happening on? Does the issue happen on latest version?
0.22.0
What platform and Node.js version? (For example Node.js 6.9.1 on Mac OS X)
8.10.0
Does the action work when you manually perform request against mailgun using curl (or other means)?
Yes
Sample source code or steps to reproduce
constmailgun=require('mailgun-js')constsendMail=mailgun({apiKey: MAILGUN_API_KEY,domain: MAILGUN_DOMAIN,}).messages().sendconstpayload={
from,
to,
subject,
text,}awaitsendMail(payload)
(Write description of your issue here, stack traces from errors and code that reproduces the issue are helpful)
The text was updated successfully, but these errors were encountered:
Hi @recidive - this is a generic (much despised) javascript "foot-gun". When you assign the send function to a variable, and call it later standalone, it is called unbound from the mailgun instance. For example, const qs = document.querySelector; qs('this.will.error'); If you bind the function though const qs = document.querySelector.bind(document); qs('all.is.well');
You could leave the issue open if your desire is to explore mailgun-js binding it's functions to accommodate this usage; otherwise, binding your send method resolves the issue.
TypeError: Cannot read property 'params' of undefined
at impl (/.../node_modules/mailgun-js/lib/build.js:42:16)
at callback (/.../node_modules/promisify-call/index.js:32:8)
at /.../node_modules/with-callback/index.js:39:7
at new Promise ()
at withCallback (/.../node_modules/with-callback/index.js:5:10)
at promisifyCall (/.../node_modules/promisify-call/index.js:28:10)
at promisifed (/.../node_modules/mailgun-js/lib/build.js:105:14)
at post (/.../src/handlers.js:39:3)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
What version of the module is the issue happening on? Does the issue happen on latest version?
0.22.0
What platform and Node.js version? (For example Node.js 6.9.1 on Mac OS X)
8.10.0
Yes
(Write description of your issue here, stack traces from errors and code that reproduces the issue are helpful)
The text was updated successfully, but these errors were encountered: