undici
undici copied to clipboard
BodyTimeoutError: Body Timeout Error | Closing process
Bug Description
I get this error
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
BodyTimeoutError: Body Timeout Error
at Timeout.onParserTimeout [as callback] (C:\Users\admin\Documents\GitHub\project\node_modules\undici\lib\dispatcher\client-h1.js:639:28)
at Timeout.onTimeout [as _onTimeout] (C:\Users\admin\Documents\GitHub\project\node_modules\undici\lib\util\timers.js:20:13)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7) {
code: 'UND_ERR_BODY_TIMEOUT'
}
Node.js v18.5.0
Once I get this error my app will close. I am catching any errors made by my undici request.
Reproducible By
const res = await request(url, Object.assign(options, this.extraConfiguration)).catch((e) => {
return resolve({})
})
options = simple headers and request body this.extraConfiguration is my proxyagent
const { ProxyAgent } = require('undici');
const parsed_url = new URL(proxy);
this.agent = new ProxyAgent({
uri: proxy
})
if (parsed_url?.username && parsed_url?.password) {
this.agent = new ProxyAgent({
uri: proxy,
auth: Buffer.from(`${parsed_url.username}:${parsed_url.password}`).toString('base64')
})
}
Expected Behavior
Error should be caught.
Logs & Screenshots
Environment
Windows 11 Node version: 18.5.0
Additional context
Can you provide an Minimum Reproducible Example that isolates the issue?