Skip to content

Commit f8dd3ea

Browse files
fix: switch to undici for requests to fix stream close errors
When updating WPT resources, the `wpt` command would sometimes throw a `ERR_STREAM_PREMATURE_CLOSE` error. Switching to `undici` fixes this issue. The `undici` `fetch` function is only supported on Node 16+. After discussing with the team, we agreed that dropping support for Node 14 in this tool was acceptable.
1 parent 267dde0 commit f8dd3ea

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
node-version: [14.x, 16.x, 18.x]
29+
node-version: [16.x, 18.x]
3030
os: [ubuntu-latest, macOS-latest, windows-latest]
3131
runs-on: ${{ matrix.os }}
3232
steps:

lib/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from 'node:fs';
22

3-
import fetch from 'node-fetch';
3+
import { fetch } from 'undici';
44

55
import { CI_DOMAIN } from './ci/ci_type_parser.js';
66
import proxy from './proxy.js';

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
"listr2": "^4.0.5",
4747
"lodash": "^4.17.21",
4848
"log-symbols": "^5.1.0",
49-
"node-fetch": "^3.2.4",
5049
"ora": "^6.1.0",
5150
"proxy-agent": "^5.0.0",
5251
"replace-in-file": "^6.3.2",
5352
"rimraf": "^3.0.2",
53+
"undici": "^5.20.0",
5454
"which": "^2.0.2",
5555
"yargs": "^17.5.0"
5656
},

0 commit comments

Comments
 (0)