Can't upload emojis: TypeError: terminated

Hi, when I try to upload emojis using a URL, it works fine locally but not in production.
await guild.emojis.create({
attachment: baseAttachmentURL, // some url to an already existing Discord emoji
name: "randomemojiname"
})
await guild.emojis.create({
attachment: baseAttachmentURL, // some url to an already existing Discord emoji
name: "randomemojiname"
})
TypeError: terminated
at Fetch.onAborted (/node_modules/undici/lib/web/fetch/index.js:2034:49)
at Fetch.emit (node:events:513:28)
at Fetch.terminate (/node_modules/undici/lib/web/fetch/index.js:93:10)
at /node_modules/undici/lib/web/fetch/index.js:506:30
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[cause]: TypeError [ERR_INVALID_ARG_TYPE]: The "stream" argument must be an instance of Stream. Received an instance of ReadableStream
at new NodeError (node:internal/errors:393:5)
at eos (node:internal/streams/end-of-stream:65:11)
at fetchFinale (/node_modules/undici/lib/web/fetch/index.js:1093:5)
at mainFetch (/node_modules/undici/lib/web/fetch/index.js:760:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
}
TypeError: terminated
at Fetch.onAborted (/node_modules/undici/lib/web/fetch/index.js:2034:49)
at Fetch.emit (node:events:513:28)
at Fetch.terminate (/node_modules/undici/lib/web/fetch/index.js:93:10)
at /node_modules/undici/lib/web/fetch/index.js:506:30
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[cause]: TypeError [ERR_INVALID_ARG_TYPE]: The "stream" argument must be an instance of Stream. Received an instance of ReadableStream
at new NodeError (node:internal/errors:393:5)
at eos (node:internal/streams/end-of-stream:65:11)
at fetchFinale (/node_modules/undici/lib/web/fetch/index.js:1093:5)
at mainFetch (/node_modules/undici/lib/web/fetch/index.js:760:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
}
What could be the issue here?
3 Replies
d.js toolkit
d.js toolkit6mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Syjalo
Syjalo6mo ago
This is most likely a Bun issue. It was already fixed in Node.js
Xge
XgeOP6mo ago
Hi, thank you so much for this tip! Even with Node.js, I still had this issue. I now switched from Node.js v18 to v20 and the issue is gone. Thanks again!
Want results from more Discord servers?
Add your server