error when sending a email on v3 - TypeError: Expected signal to be an instanceof AbortSignal
See original GitHub issueError when sending email with mailgun: TypeError: Expected signal to be an instanceof AbortSignal
at new Request (app/node_modules/node-fetch/lib/index.js:1222:10)
at new v (app/node_modules/mailgun.js/dist/mailgun.js:2:30777)
at Object.t [as default] (app/node_modules/mailgun.js/dist/mailgun.js:2:34628)
at e.<anonymous> (app/node_modules/mailgun.js/dist/mailgun.js:2:11808)
at app/node_modules/mailgun.js/dist/mailgun.js:2:10637
at Object.next (app/node_modules/mailgun.js/dist/mailgun.js:2:10742)
at app/node_modules/mailgun.js/dist/mailgun.js:2:9654
at new Promise (<anonymous>)
at o (app/node_modules/mailgun.js/dist/mailgun.js:2:9399)
at e.request (app/node_modules/mailgun.js/dist/mailgun.js:2:11368)
at e.command (app/node_modules/mailgun.js/dist/mailgun.js:2:12652)
at e.postMulti (app/node_modules/mailgun.js/dist/mailgun.js:2:13422)
at e.create (app/node_modules/mailgun.js/dist/mailgun.js:2:8669)
import Mailgun from 'mailgun.js';
import formData from 'form-data';
const mailgun = new Mailgun(formData);
const mg = mailgun.client({
username: 'api',
key: config.MAILGUN.MAILGUN_API_KEY,
});
return await mg.messages.create(domain, message);
this is using node with webpack
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:14 (3 by maintainers)
Top Results From Across the Web
error when sending a email on v3 - TypeError: Expected ...
Error when sending email with mailgun: TypeError: Expected signal to be an instanceof AbortSignal at new Request ...
Read more >Error with Lambda Function running on NodeJS netlify ...
My function always seems to return an error in development which says Function invocation failed: TypeError: Expected signal to be an instanceof ...
Read more >[JS Client] Expected signal to be an instanceof AbortSignal
When webpacking in production mode for nodejs an application that uses Ktor JS client with new IR compialtion backend and running it, any...
Read more >https://unpkg.com/node-fetch@3.0.0-beta.6/dist/ind...
isAbortSignal(signal)) { throw new TypeError('Expected signal to be an instanceof AbortSignal'); } this[INTERNALS$2] = { method, redirect: init.redirect ...
Read more >TypeError: Expected signal to be an instanceof AbortSignal
My function always seems to return an error in development which says Function invocation failed: TypeError: Expected signal to be an instanceof AbortSignal ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@darrylyoung @ssijak Node.js doesn’t have
AbortController
by default, and when the request library used by mailgun.js (ky-universal) sees that, it tries to polyfill it usingabort-controller
. This module will NOT work in a Node.js environment, so we have to polyfill it ourselves usingnode-abort-controller
.First install the module:
Then import and polyfill
AbortController
before importing mailgun.js, so ky-universal will see it in the global context and won’t try to override it:To me, this feels like an upstream compatibility issue with ky-universal, rather than a bug in mailgun.js, but they might want to mention this in their docs until the maintainers of ky-universal do something about it.
I hope one day ppl at Mailgun hire some one for writting better technical documentation