postContent.matchAll(...) is not a function or its return value is not iterable
RalphCorderoy opened this issue · 3 comments
RalphCorderoy commented
I get the error postContent.matchAll(...) is not a function or its return value is not iterable
. Looking at the XML, there's only two posts and neither have images. (Most of the XML is pages rather than posts.)
const matches = [...postContent.matchAll(/<img[^>]*src="(.+?\.(?:gif|jpe?g|png))"[^>]*>/gi)];
lonekorean commented
Are you using Node.js v12.14 or later?
RalphCorderoy commented
Hi @lonekorean, No, I agree, that's the problem: there's no matchAll in Debian Stable. Sorry for the noise.
lonekorean commented
@RalphCorderoy no worries. I should probably add a check in code and give a more helpful error message. :)