TypeError: import_undici4.FormData is not a constructor

I get this error : TypeError: import_undici4.FormData is not a constructor when i try to send an attachment Code :
const canvas = Canvas.createCanvas(700, 250);

const ctx = canvas.getContext('2d');

ctx.fillStyle = `${res.data.banner_color}`;

ctx.fillRect(0, 0, canvas.width, canvas.height);

const attachment = new AttachmentBuilder(canvas.toBuffer("image/png"), { name: "banner.png" });

embed.setImage(`attachment://${attachment.name}`);

await interaction.reply({ embeds: [embed], files: [attachment] })
const canvas = Canvas.createCanvas(700, 250);

const ctx = canvas.getContext('2d');

ctx.fillStyle = `${res.data.banner_color}`;

ctx.fillRect(0, 0, canvas.width, canvas.height);

const attachment = new AttachmentBuilder(canvas.toBuffer("image/png"), { name: "banner.png" });

embed.setImage(`attachment://${attachment.name}`);

await interaction.reply({ embeds: [embed], files: [attachment] })
8 Replies
Favna
Favna2y ago
Update to a newer version of NodeJS. The minimum is 16.8 iirc but you should be on Node 18 at the least.
ItaChi
ItaChiOP2y ago
I installed NodeJS V16.6.0 hardly because i am using windows 7 pepeFeelsBadMan
Favna
Favna2y ago
Using Windows 7 and being connected to the internet is your real problem. There are more security exploits for Windows 7 than stars in the universe at this point.
ItaChi
ItaChiOP2y ago
My real problem is my laptop specs pepeFeelsBadManpepeFeelsBadMan
Favna
Favna2y ago
bullshit Windows 10 runs on the same specs as Windows 7 and even if not you could install a light weight Linux such as Lubuntu there is absolutely 0 reason to run windows 7 and this point and you SHOULD get rid of it and do EVERYTHING in your power to do so
ItaChi
ItaChiOP2y ago
But it won't run on this specs wtfummm E1-1200 APU Amd Radeon HD 7310 2GB RAM notKEKW
Favna
Favna2y ago
Linux will anyway whatever you do Itachi, DJS and Sapphire require a higher Node version so you'll need to solve that and please please please I beg you, stop using Windows 7. For your own safety and everyone on the same network as you
Want results from more Discord servers?
Add your server