Skip to content

Commit f759e7a

Browse files
fix: switch to undici for requests to fix stream close errors (#666)
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.js 16.8+. BREAKING CHANGE: Node.js 14.x is no longer supported.
1 parent 267dde0 commit f759e7a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.github/workflows/nodejs.yml

+1-1
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, 19.x]
3030
os: [ubuntu-latest, macOS-latest, windows-latest]
3131
runs-on: ${{ matrix.os }}
3232
steps:

lib/request.js

+1-1
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

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "2.1.3",
44
"description": "Utilities for Node.js core collaborators",
55
"type": "module",
6+
"engines": {
7+
"node": ">=16.8.0"
8+
},
69
"bin": {
710
"get-metadata": "./bin/get-metadata.js",
811
"git-node": "./bin/git-node.js",
@@ -46,11 +49,11 @@
4649
"listr2": "^4.0.5",
4750
"lodash": "^4.17.21",
4851
"log-symbols": "^5.1.0",
49-
"node-fetch": "^3.2.4",
5052
"ora": "^6.1.0",
5153
"proxy-agent": "^5.0.0",
5254
"replace-in-file": "^6.3.2",
5355
"rimraf": "^3.0.2",
56+
"undici": "^5.20.0",
5457
"which": "^2.0.2",
5558
"yargs": "^17.5.0"
5659
},

0 commit comments

Comments
 (0)