-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
npm:undici not working (Connect Timeout Error) #19532
Comments
I am not able to reproduce this; possibly a windows specific error? |
Maybe yes PS C:\Users\Lami> irm https://deno.land/install.ps1 | iex
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 30.3M 100 30.3M 0 0 30.3M 0 0:00:01 --:--:-- 0:00:01 30.3M
Deno was installed successfully to C:\Users\Lami\.deno\bin\deno.exe
Run 'deno --help' to get started
Stuck? Join our Discord https://discord.gg/deno
PS C:\Users\Lami> deno
Deno 1.35.0
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> import { request } from "npm:undici"
await request("https://jsonplaceholder.typicode.com/todos/1")
Uncaught ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (file:///C:/Users/Lami/AppData/Local/deno/npm/registry.npmjs.org/undici/5.22.1/lib/core/connect.js:182:24)
at file:///C:/Users/Lami/AppData/Local/deno/npm/registry.npmjs.org/undici/5.22.1/lib/core/connect.js:129:46
at file:///C:/Users/Lami/AppData/Local/deno/npm/registry.npmjs.org/undici/5.22.1/lib/core/connect.js:168:33
at Object.action (ext:deno_web/02_timers.js:153:11)
at handleTimerMacrotask (ext:deno_web/02_timers.js:67:10)
at eventLoopTick (ext:core/01_core.js:189:21)
> Of course fetch works in environments where undici doesn't work. So it's not about the network or anything. > await fetch('https://jsonplaceholder.typicode.com/todos/1')
Response {
body: ReadableStream { locked: false },
bodyUsed: false,
headers: Headers {
"access-control-allow-credentials": "true",
age: "630",
"alt-svc": 'h3=":443"; ma=86400',
"cache-control": "max-age=43200",
"cf-cache-status": "HIT",
"cf-ray": "7e4d1b900aca2635-NRT",
"content-type": "application/json; charset=utf-8",
date: "Tue, 11 Jul 2023 01:00:07 GMT",
etag: 'W/"53-hfEnumeNh6YirfjyjaujcOPPT+s"',
expires: "-1",
nel: '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}',
pragma: "no-cache",
"report-to": '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=8JU1QfR3ezrPM5UYvJGo2DY43mIdswRNi'... 179 more characters,
server: "cloudflare",
vary: "Origin, Accept-Encoding",
via: "1.1 vegur",
"x-content-type-options": "nosniff",
"x-powered-by": "Express",
"x-ratelimit-limit": "1000",
"x-ratelimit-remaining": "999",
"x-ratelimit-reset": "1683994374"
},
ok: true,
redirected: false,
status: 200,
statusText: "OK",
url: "https://jsonplaceholder.typicode.com/todos/1"
} |
+1. I try to use it in WSL and all works fine. It is lock to use my framework on Windows in Deno runtime... |
import { request } from "npm:undici";
console.log(await request("https://jsonplaceholder.typicode.com/todos/1")); Seems like it works now on Deno 2.0 |
It appears to have been resolved as a result of the following issue, but it still does not work in my environment.
#16710
I used @discordjs/rest to test the behavior, but only undici actually causes errors.
My enviroments:
deno 1.34.3 (release, x86_64-pc-windows-msvc)
v8 11.5.150.2
typescript 5.0.4
The text was updated successfully, but these errors were encountered: