From 5bae9a09714e08e3a437138e7543de7f534bd33a Mon Sep 17 00:00:00 2001 From: Martin DONADIEU Date: Sat, 17 Feb 2024 23:42:01 +0000 Subject: [PATCH 1/2] fix: add node prefix for util to fix issue in env with min version node 18 --- lib/fetch/body.js | 2 +- lib/fetch/util.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fetch/body.js b/lib/fetch/body.js index 2781a7b90d9..65fd63c5b23 100644 --- a/lib/fetch/body.js +++ b/lib/fetch/body.js @@ -17,7 +17,7 @@ const { webidl } = require('./webidl') const { Blob, File: NativeFile } = require('node:buffer') const assert = require('node:assert') const { isErrored } = require('../core/util') -const { isArrayBuffer } = require('util/types') +const { isArrayBuffer } = require('node:util/types') const { File: UndiciFile } = require('./file') const { serializeAMimeType } = require('./dataURL') const { Readable } = require('node:stream') diff --git a/lib/fetch/util.js b/lib/fetch/util.js index 82e96ec9acd..fdda578213e 100644 --- a/lib/fetch/util.js +++ b/lib/fetch/util.js @@ -8,7 +8,7 @@ const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, pa const { performance } = require('node:perf_hooks') const { isBlobLike, ReadableStreamFrom, isValidHTTPToken } = require('../core/util') const assert = require('node:assert') -const { isUint8Array } = require('util/types') +const { isUint8Array } = require('node:util/types') const { webidl } = require('./webidl') // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable From 26750f149a52998e8d1260cf2db76177fb37aebf Mon Sep 17 00:00:00 2001 From: Martin Donadieu Date: Sun, 18 Feb 2024 15:26:15 +0100 Subject: [PATCH 2/2] fix: add missing prefix --- test/fetch/pull-dont-push.js | 8 ++++---- test/websocket/messageevent.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/fetch/pull-dont-push.js b/test/fetch/pull-dont-push.js index 5dbf331f397..58eaee3e8fd 100644 --- a/test/fetch/pull-dont-push.js +++ b/test/fetch/pull-dont-push.js @@ -3,10 +3,10 @@ const { test } = require('node:test') const assert = require('node:assert') const { fetch } = require('../..') -const { createServer } = require('http') -const { once } = require('events') -const { Readable, pipeline } = require('stream') -const { setTimeout: sleep } = require('timers/promises') +const { createServer } = require('node:http') +const { once } = require('node:events') +const { Readable, pipeline } = require('node:stream') +const { setTimeout: sleep } = require('node:timers/promises') const { closeServerAsPromise } = require('../utils/node-http') diff --git a/test/websocket/messageevent.js b/test/websocket/messageevent.js index 372cdd2ba89..e1ab3d16dd7 100644 --- a/test/websocket/messageevent.js +++ b/test/websocket/messageevent.js @@ -1,7 +1,7 @@ 'use strict' const { test } = require('node:test') -const assert = require('assert') +const assert = require('node:assert') const { MessageEvent } = require('../..') test('test/parallel/test-messageevent-brandcheck.js', () => {