Error: TypeError: s is not iterable
See original GitHub issueI am getting this error:
TypeError: s is not iterable
at a (/Users/hervefulchiron/Downloads/GitHub/bee/node_modules/mailgun.js/dist/mailgun.js:2:31148)
at u (/Users/hervefulchiron/Downloads/GitHub/bee/node_modules/mailgun.js/dist/mailgun.js:2:31423)
at w (/Users/hervefulchiron/Downloads/GitHub/bee/node_modules/mailgun.js/dist/mailgun.js:2:37337)
at Object.t [as default] (/Users/hervefulchiron/Downloads/GitHub/bee/node_modules/mailgun.js/dist/mailgun.js:2:37378)
at e.<anonymous> (/Users/hervefulchiron/Downloads/GitHub/bee/node_modules/mailgun.js/dist/mailgun.js:2:14352)
at /Users/hervefulchiron/Downloads/GitHub/bee/node_modules/mailgun.js/dist/mailgun.js:2:13146
at Object.next (/Users/hervefulchiron/Downloads/GitHub/bee/node_modules/mailgun.js/dist/mailgun.js:2:13251)
at /Users/hervefulchiron/Downloads/GitHub/bee/node_modules/mailgun.js/dist/mailgun.js:2:12163
at new Promise (<anonymous>)
at n (/Users/hervefulchiron/Downloads/GitHub/bee/node_modules/mailgun.js/dist/mailgun.js:2:11908)
error Command failed with exit code 1.
using:
"mailgun.js": "^3.4.0",
and this code:
const formData = require('form-data')
const Mailgun = require('mailgun.js')
const mailgun = new Mailgun(formData)
const mg = mailgun.client({
username: 'api',
key: '64xxxxxe66',
})
mg.messages.create('bitcoinvsalts.com', {
from: "Excited User <mailgun@sandbox-123.mailgun.org>",
to: ["herve@gmail.com"],
subject: "Hello",
text: "s fsfsdfsdfsf sd f"
})
.then( msg => {
console.log("MAILGUN:", msg)
})
.catch( err => {
console.log("MAILGUN ERROR:", err)
})
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Why are Objects not Iterable in JavaScript? - Stack Overflow
I tried the below code, but I get a TypeError: can't convert undefined to object . var example = {a: {e: 'one', f:...
Read more >TypeError: 'x' is not iterable - JavaScript
The JavaScript exception "is not iterable" occurs when the value which is given as the right hand-side of for…of or as argument of...
Read more >Error: TypeError: s is not iterable · Issue #159 - GitHub
This happens when the code is inside an async function (I'm testing in lambda function). async (data) => { const mg = new...
Read more >TypeError: 'X' is not iterable in JavaScript | bobbyhadz
The "TypeError: 'X' is not iterable" occurs when using the for...of loop with a right-hand side value that is not iterable, e.g. an...
Read more >Errors: Is Not Iterable - JavaScript - W3cubDocs
TypeError : 'x' is not iterable ... The JavaScript exception "is not iterable" occurs when the value which is given as the right-hand...
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
FIX: pin the “node-fetch” version
The clue came from @dsalcedo issue that showed the source-maps and “validateAndMerge”, which is part of “ky-universal” package. Following that down, it uses “node-fetch” with that version. I pinned my package version to the same one and it all works!
I would guess the issue is caused somewhere if “node-fetch” is in your project, either explicitly or implicitly through “isomorphic-fetch”
Same issue here, indeed multiple node-fetch versions through transitive installation:
fixed by installing isomorphic-fetch@3, even though oddly that still uses a separate node-fetch:
Maybe mailgun.js should require node-fetch as a peer dep