From a3d8a9861c83cf37cc77071c7e0e063db6b561f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Tue, 21 Sep 2021 16:44:04 +0200 Subject: [PATCH 1/2] fix: import whatwg-url in a way compatible with ESM Node --- src/request.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/request.js b/src/request.js index 3c27c81cf..59850fd95 100644 --- a/src/request.js +++ b/src/request.js @@ -9,11 +9,12 @@ import Url from 'url'; import Stream from 'stream'; -import {URL} from 'whatwg-url'; +import whatwgUrl from 'whatwg-url'; import Headers, { exportNodeCompatibleHeaders } from './headers.js'; import Body, { clone, extractContentType, getTotalBytes } from './body'; const INTERNALS = Symbol('Request internals'); +const URL = whatwgUrl.URL; // fix an issue where "format", "parse" aren't a named export for node <10 const parse_url = Url.parse; From cc24492e85c5c38555db087a1bf1f033c85608bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Wed, 22 Sep 2021 10:58:27 +0200 Subject: [PATCH 2/2] release: 2.6.5 --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46eef0ff0..29d168cf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ Changelog # 2.x release +## v2.6.5 + +- Fix: import `whatwg-url` in a way compatible with ESM + ## v2.6.4 - Hotfix: fix v2.6.3 that did not sending query params diff --git a/package.json b/package.json index 98cf5f4c5..4178c1a32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-fetch", - "version": "2.6.4", + "version": "2.6.5", "description": "A light-weight module that brings window.fetch to node.js", "main": "lib/index.js", "browser": "./browser.js",