Repository navigation
current issues with network #653
Description
- node-fetch not working on 18 (maybe only with proxy)
- proxy only support http, sock5 not working
Activity
This is breaking the
request-ciworkflow on nodejs/node: https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780Run ./tools/actions/start-ci.sh 45179 + REQUEST_CI_LABEL=request-ci + REQUEST_CI_FAILED_LABEL=request-ci-failed + gh pr edit 451[7](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:8)9 --remove-label request-ci https://github.com/nodejs/node/pull/45179 + ci_started=yes + rm -f output + ncu-ci run 45179 + cat output - Validating Jenkins credentials ✔ Jenkins credentials valid + [ yes = no ] - Starting PR CI job (node:1[8](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:9)[10](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:11)) [https://github.com/node-fetch/node-fetch/issues/[11](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:12)67] DeprecationWarning: form-data doesn't follow the spec and requires special treatment. Use alternative package (Use `node --trace-deprecation ...` to show where the warning was created) [DEBUG] FetchError: request to https://ci.nodejs.org/job/node-test-pull-request/build failed, reason: socket hang up at ClientRequest.<anonymous> (file:///opt/hostedtoolcache/node/18.[12](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:13).0/x64/lib/node_modules/node-core-utils/node_modules/node-fetch/src/index.js:108:11) at ClientRequest.emit (node:events:525:35) at TLSSocket.socketCloseListener (node:_http_client:467:11) at TLSSocket.emit (node:events:525:35) at node:net:3[13](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:14):12 at TCP.done (node:_tls_wrap:587:7) { type: 'system', errno: 'ECONNRESET', code: 'ECONNRESET', erroredSysCall: undefined } ✖ Failed to start CI@aduh95 Downgrade to Node 16 temporally maybe ?
In the long run, should we replace node-fetch ?
Reacted by avivnakarIn the long run, should we replace node-fetch ?
I'd say yes, possibly with
globalThis.fetchnow that it's available.First issue since v18 became lts :)
Related node-fetch issue: node-fetch/node-fetch#1624
This is breaking the
request-ciworkflow on nodejs/node: https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780There's another issue here which is the breakage doesn't cause the workflow to fail. From that run the
request-cilabel was removed from nodejs/node#45179 but because of the issue with node-fetch no CI job was actually queued in Jenkins.I believe the issue is deeper than node-fetch specifically
This snippet fails at 18 lts, and works with 16http.request('http://localhost:4040/api/tunnels') .on('response', (res) => { let str = ''; res.on('data', d => str += d); res.on('end', () => console.log( JSON.parse(str).tunnels[0].public_url )) }).end()
All of these are failing on 18 but working on 16.
node -e "require('node-fetch').default('http://localhost:4040/api/tunnels').then(res=>res.json()).then(res=>res.tunnels[0].public_url).then(console.log)" node -e "http.request('http://localhost:4040/api/tunnels').on('response',(res)=>{let str=''; res.on('data',d=>str+=d); res.on('end',()=>console.log(JSON.parse(str).tunnels[0].public_url))}).end()" node -e "fetch('http://localhost:4040/api/tunnels').then(res=>res.json()).then(res=>res.tunnels[0].public_url).then(console.log)"
Btw it's ngrok api, if you wish testing yourself, run
ngrok http 5000or any other port instead of 5000@avivnakar better report it in
nodejs/noderepo with repro (ngrok has an npm module IIRC).