Skip to content

Commit 31a538d

Browse files
authored
Update @types/node-fetch to latest (#36953)
Currently, if you try the following code while developing with Next.js inside Middleware: ```ts const url = new URL(MY_URL) const res = await fetch(url) ``` The app will work as expected, and so will the dom types for TS 4.5+. However when running `next build` or `tsc` typescript fails with: <img width="837" alt="image" src="https://user-images.githubusercontent.com/4278345/168647502-06b8b223-e0cf-4e8b-9a82-cdac51748789.png"> The types for `node-fetch` have been updated to include `URL` so this PR updates the dependency to fix it. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
1 parent 7b83c19 commit 31a538d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"@types/lodash.curry": "4.1.6",
148148
"@types/lru-cache": "5.1.0",
149149
"@types/micromatch": "4.0.2",
150-
"@types/node-fetch": "2.3.4",
150+
"@types/node-fetch": "2.6.1",
151151
"@types/path-to-regexp": "1.7.0",
152152
"@types/react": "16.9.17",
153153
"@types/react-dom": "16.9.4",

yarn.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5216,11 +5216,13 @@
52165216
dependencies:
52175217
"@types/node" "*"
52185218

5219-
5220-
version "2.3.4"
5221-
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.3.4.tgz#a46fc4fe9f94b491bf551b6bb7f0f493b9bacd1a"
5219+
5220+
version "2.6.1"
5221+
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.1.tgz#8f127c50481db65886800ef496f20bbf15518975"
5222+
integrity sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==
52225223
dependencies:
52235224
"@types/node" "*"
5225+
form-data "^3.0.0"
52245226

52255227
"@types/node@*", "@types/[email protected]", "@types/node@>= 8":
52265228
version "13.11.0"

0 commit comments

Comments
 (0)