From b88ab4654950899a4fb1fc47ac5cdef1d78ccb64 Mon Sep 17 00:00:00 2001 From: Daniel Bankhead Date: Thu, 15 Feb 2024 11:02:13 -0800 Subject: [PATCH] fix: `URL` imports for Node 14 (#289) --- .changeset/strong-cups-listen.md | 6 ++++++ packages/http-proxy-agent/src/index.ts | 2 +- packages/https-proxy-agent/src/index.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/strong-cups-listen.md diff --git a/.changeset/strong-cups-listen.md b/.changeset/strong-cups-listen.md new file mode 100644 index 00000000..abb129fe --- /dev/null +++ b/.changeset/strong-cups-listen.md @@ -0,0 +1,6 @@ +--- +"http-proxy-agent": patch +"https-proxy-agent": patch +--- + +Import `url` instead of `node:url` 🤷‍♂️ diff --git a/packages/http-proxy-agent/src/index.ts b/packages/http-proxy-agent/src/index.ts index b0e5f3ef..47b9d660 100644 --- a/packages/http-proxy-agent/src/index.ts +++ b/packages/http-proxy-agent/src/index.ts @@ -4,7 +4,7 @@ import * as http from 'http'; import createDebug from 'debug'; import { once } from 'events'; import { Agent, AgentConnectOpts } from 'agent-base'; -import { URL } from 'node:url'; +import { URL } from 'url'; import type { OutgoingHttpHeaders } from 'http'; const debug = createDebug('http-proxy-agent'); diff --git a/packages/https-proxy-agent/src/index.ts b/packages/https-proxy-agent/src/index.ts index d0332a66..47da1dc3 100644 --- a/packages/https-proxy-agent/src/index.ts +++ b/packages/https-proxy-agent/src/index.ts @@ -4,7 +4,7 @@ import * as http from 'http'; import assert from 'assert'; import createDebug from 'debug'; import { Agent, AgentConnectOpts } from 'agent-base'; -import { URL } from 'node:url'; +import { URL } from 'url'; import { parseProxyResponse } from './parse-proxy-response'; import type { OutgoingHttpHeaders } from 'http';