TypeError [ERR_INVALID_ARG_TYPE]: The "stream" argument must be an instance of Stream.

my bot has been running fine in production for years but today i'm getting this message on startup with no changes of any kind:
/home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:2046
fetchParams.controller.controller.error(new TypeError('terminated', {
^

TypeError: terminated
at Fetch.onAborted (/home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:2046:49)
at Fetch.emit (node:events:513:28)
at Fetch.terminate (/home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:93:10)
at /home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:511: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 (/home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:1101:5)
at mainFetch (/home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:765:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
}
/home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:2046
fetchParams.controller.controller.error(new TypeError('terminated', {
^

TypeError: terminated
at Fetch.onAborted (/home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:2046:49)
at Fetch.emit (node:events:513:28)
at Fetch.terminate (/home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:93:10)
at /home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:511: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 (/home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:1101:5)
at mainFetch (/home/ubuntu/dice-witch/node_modules/undici/lib/web/fetch/index.js:765:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
}
i'm using bun and djs 14.16.3
2 Replies
d.js toolkit
d.js toolkit2mo 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
hiarcs
hiarcsOP2mo ago
resolved, for anyone searching int he future it was this, needed to update node version https://github.com/nodejs/undici/issues/3123
GitHub
undici.fetch breaks on Node.js <=18.13.0 in [email protected] · Issue...
Bug Description Since [email protected], undici.fetch breaks on Node.js 18.13.0 and earlier. "package.json" includes: "engines": { "node": ">=18.0" }, but I&#...
Want results from more Discord servers?
Add your server