-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove cross-fetch lib as we use Node18 everywhere #10146
Comments
Removed from several packages in #11223. Removing in from Removing it from |
Lets not do this before Node19. It has some differeneces and causing troubles. See: #11820 (Details: https://satoshilabs.slack.com/archives/C02V2PSDNA2/p1711539811017599) |
Here is also relevant Github Issue: nodejs/node#46375 |
Also good read: https://betterstack.com/community/guides/scaling-nodejs/nodejs-timeouts/#timing-out-a-fetch-api-request It says that in node fetch has no timeout, but it seems that its not true
|
Finally another issue: nodejs/undici#1373 TBH I dont see a good solution to this right now :( |
Maybe a solution is to use const { Agent } = require('undici');
dispatcher = new Agent({
connectTimeout: 10 * 60e3, // 10 minutes
bodyTimeout: 10 * 60e3, // 10 minutes
headersTimeout: 10 * 60e3, // 10 minutes
})
globalThis[Symbol.for('undici.globalDispatcher.1')] = dispatcher
// ----------------------------------------------------------------------------
const t = Date.now()
const run = async () => {
try {
await fetch("https://192.168.0.1");
} finally {
console.log((Date.now() - t) / 1000);
}
}
run(); Source of the idea: nodejs/undici#1373 (comment) |
It's not pressing, let's update |
cross-fetch
The text was updated successfully, but these errors were encountered: