this._listeners[eventName] is not iterable
ryder-james opened this issue · comments
Ryder James commented
Running a fairly simple search:
const commanders = [];
Scry.Cards.search('is:commander legal:commander game:paper')
.on('data', card => {
commanders.push(card);
})
.on('end', () => {
console.log(`found ${commanders.length} results`);
});
But getting this error:
<path>\node_modules\scryfall-sdk\out\util\EventEmitter.js:70
for (const listener of this._listeners[eventName])
^
TypeError: this._listeners[eventName] is not iterable
at MagicEmitter.emit (<path>\node_modules\scryfall-sdk\out\util\EventEmitter.js:70:47)
at MagicEmitter.emit (<path>\node_modules\scryfall-sdk\out\util\MagicEmitter.js:51:22)
at <path>\node_modules\scryfall-sdk\out\api\Cards.js:433:35
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Chiri Vulpes commented
Hmm, I think this is the same thing fixed by the suggested PR #69, I wonder why this wouldn't be covered by the existing tests. I'll take a look tomorrow. Thanks for the report!
Chiri Vulpes commented