Error: Unsupported image type
at setSource (C:\Users\Utente\Desktop\DS\node_modules\canvas\lib\image.js:94:13)
at C:\Users\Utente\Desktop\DS\node_modules\canvas\lib\image.js:62:11
at C:\Users\Utente\Desktop\DS\node_modules\simple-get\index.js:97:7
at IncomingMessage. (C:\Users\Utente\Desktop\DS\node_modules\simple-concat\index.js:8:13)
at Object.onceWrapper (node:events:633:28)
at IncomingMessage.emit (node:events:531:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
This is probably not an issue with node-canvas. More likely, the image is corrupted. If you still need help, can you post the image that's not loading please?
`const Discord = require("discord.js") const client = new Discord.Client({ intents: Object.values(Discord.IntentsBitField.Flags)})
client.once("ready", () => { console.log(
Logged in as ${client.user.tag}!
); console.log(client.user.tag) }); client.login("token")const { createCanvas, loadImage, MessageAttachment } = require('canvas');
client.on('guildMemberAdd', async (member) => { const welcomeChannel = client.channels.cache.get('1188962541842485353'); const rulesChannel = client.channels.cache.get('1192109584777760868'); const verifyChannel = client.channels.cache.get('1193611427450200078'); const infoChannel = client.channels.cache.get('1192102711718596688');
if (welcomeChannel && rulesChannel && verifyChannel && infoChannel) { console.log("Sto per inviare il messaggio di benvenuto a:", member.user.tag);
} }); ` node:events:497 throw er; // Unhandled 'error' event ^
Error: Unsupported image type at setSource (C:\Users\Utente\Desktop\DS\node_modules\canvas\lib\image.js:94:13) at C:\Users\Utente\Desktop\DS\node_modules\canvas\lib\image.js:62:11 at C:\Users\Utente\Desktop\DS\node_modules\simple-get\index.js:97:7 at IncomingMessage. (C:\Users\Utente\Desktop\DS\node_modules\simple-concat\index.js:8:13)
at Object.onceWrapper (node:events:633:28)
at IncomingMessage.emit (node:events:531:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
Node.js v21.5.0