Comments (3)
@metcoder95 what you posted would be the intended outcome. You're not logging if it was a header or body timeout. header timeouts appeared to throw a TimeoutError in my tests.
but today I can't replicate it any longer. Neither with undici 6.16.0 nor any later version...
According to the stacktrace the error is thrown here
at Fetch.abort (/home/sia/dev/platform/next-server/node_modules/undici/lib/fetch/index.js:108:15)
but there is no such location. The stacktrace is swallowing the web
directory. it should've been
/home/sia/dev/platform/next-server/node_modules/undici/lib/web/fetch/index.js
It throws there when error is falsy. I'll try to figure out how that can happen
from undici.
Tested with latest main without success:
const { fetch: undiciFetch } = require('undici')
async function test (method) {
const signal = AbortSignal.timeout(1000)
const res = await method(
'https://httpbin.org/drip?duration=2&numbytes=10&code=200&delay=0',
{ signal }
)
await res.arrayBuffer()
}
test(undiciFetch).then(
() => {
console.log('undicifetch: done')
},
err => console.log('undicifetch:', err)
)
test(fetch).then(
() => {
console.log('fetch: done')
},
err => console.log('fetch:', err)
)
Outcome:
undicifetch: DOMException [TimeoutError]: The operation was aborted due to timeout
at new DOMException (node:internal/per_context/domexception:53:5)
at Timeout._onTimeout (node:internal/abort_controller:130:9)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
fetch: DOMException [TimeoutError]: The operation was aborted due to timeout
at new DOMException (node:internal/per_context/domexception:53:5)
at Timeout._onTimeout (node:internal/abort_controller:130:9)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
from undici.
Can't replicate it anymore
from undici.
Related Issues (20)
- inconsistent setDate(0) behaviour between windows and linux HOT 1
- Nightly tests are failing HOT 6
- `UND_ERR_CONNECT_TIMEOUT` errors thrown when there is CPU intensive code on the event loop HOT 6
- Expose "Content-Encoding" handling publicly HOT 11
- Update automated release scripts to release from the v6.x branch
- Missing `6.19.4` tag/github release? HOT 1
- DELETED HOT 6
- `fetch` hangs indefinitely during second request to a certain webpage when using HTTP/2 HOT 4
- `undici.fetch` does not implement `body.dump()` as similar to `undici.request` (`Uncaught TypeError: response.body.dump is not a function`) HOT 1
- ERR_TLS_CERT_ALTNAME_INVALID error when using the proxy support (ProxyAgent) HOT 1
- react-scripts build is failing with TS1005 for balanced-pool.d.ts type HOT 5
- Can't use Undici with Brightdata proxy (error 407) HOT 1
- MockAgent not compatible with ProxyAgent,EnvHttpProxyAgent,RetryAgent HOT 2
- I do not receive set-cookie in response.headers.getSetCookie() HOT 5
- Missing bytes() mixin in response.body from request method HOT 1
- how to use maxRedirections in fetch api HOT 1
- WebSocket Data Transfer Slows Down After Node.js 16.14.2 Release
- code error HOT 1
- Nightly tests are failing HOT 23
- ProxyAgent ignore & skip & rewrite "connect" parameter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from undici.