Skip to content

Commit b5417ae

Browse files
authored
fix: import whatwg-url in a way compatible with ESM Node (#1303)
* fix: import whatwg-url in a way compatible with ESM Node * release: 2.6.5
1 parent 18193c5 commit b5417ae

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ Changelog
55

66
# 2.x release
77

8+
## v2.6.5
9+
10+
- Fix: import `whatwg-url` in a way compatible with ESM
11+
812
## v2.6.4
913

1014
- Hotfix: fix v2.6.3 that did not sending query params

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-fetch",
3-
"version": "2.6.4",
3+
"version": "2.6.5",
44
"description": "A light-weight module that brings window.fetch to node.js",
55
"main": "lib/index.js",
66
"browser": "./browser.js",

src/request.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99

1010
import Url from 'url';
1111
import Stream from 'stream';
12-
import {URL} from 'whatwg-url';
12+
import whatwgUrl from 'whatwg-url';
1313
import Headers, { exportNodeCompatibleHeaders } from './headers.js';
1414
import Body, { clone, extractContentType, getTotalBytes } from './body';
1515

1616
const INTERNALS = Symbol('Request internals');
17+
const URL = whatwgUrl.URL;
1718

1819
// fix an issue where "format", "parse" aren't a named export for node <10
1920
const parse_url = Url.parse;

0 commit comments

Comments
 (0)