#TypeError: import_undici4.FormData is not a constructor

1 messages · Page 1 of 1 (latest)

mint rock
#

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] })
zinc valveBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

hot geyser
#

Update to a newer version of NodeJS. The minimum is 16.8 iirc but you should be on Node 18 at the least.

mint rock
hot geyser
#

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.

mint rock
hot geyser
#

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

mint rock
hot geyser
#

Linux will

hot geyser
#

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