The 'credentials' field on 'RequestInitializerDict' is not implemented
See original GitHub issueHi, trying to use mailgun-js in Cloudflare Workers.
This returns The 'credentials' field on 'RequestInitializerDict' is not implemented
.
try {
await mailgun.client({
username: 'api',
key: MAILGUN_APIKEY,
timeout: 10000,
})
.messages.create(MAILGUN_DOMAIN, {
from: 'Website Contact <website@' + MAILGUN_DOMAIN + '>',
to: EMAIL_TO,
subject: 'Contact Form: ' + body.subject,
text: body.email + '\n' + body.message,
});
} catch (e) {
console.error(e);
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
The `credentials` field on `RequestInitializerDict` is not ...
I am experiencing the same issue with credentials that prevents ky from being used with Cloudflare Workers that redaxios is also ...
Read more >Fetch() init.cache mode error - Developers
Uncaught (in promise) Error: The 'cache' field on 'RequestInitializerDict' is not implemented. at fetchFromDb (worker.js:22131:26) at ...
Read more >TypeError: Incorrect type for the 'headers' field on ' ...
Fix with this: let apiRequest = new Object apiRequest.headers = Object.assign(basicHeaders, additionHeaders) apiRequest.body ...
Read more >ardatan/graphql-tools release-1662389474291 on GitHub
This prevents an error like (The 'credentials' field on 'RequestInitializerDict' is not implemented.) on the environments that don't support ...
Read more >Throw an error for unimplemented `fetch` options #134
Error: The 'mode' field on 'RequestInitializerDict' is not implemented. at doFetch (worker.js:7:23) at worker.js:2:21. Usually this happens when I'm being ...
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
After trying to hack together a solution with the library by calling internal functions, I ended up getting an openssl error due to cloudflare workers using node version 17 which wasn’t compatible with some crypto stuff mailgun uses.
Decided to say screw it and just called the API directly like you 😆 if it works it works I guess!
@ColdSauce I just wrote a raw API call to mailgun: https://github.com/iron-security/website/blob/main/workers/index.js#L113 I was a bit disappointed.