Skip to content

Commit

Permalink
Update @types/node-fetch to latest (#36953)
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
lfades committed May 16, 2022
1 parent 7b83c19 commit 31a538d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/next/package.json
Expand Up @@ -147,7 +147,7 @@
"@types/lodash.curry": "4.1.6",
"@types/lru-cache": "5.1.0",
"@types/micromatch": "4.0.2",
"@types/node-fetch": "2.3.4",
"@types/node-fetch": "2.6.1",
"@types/path-to-regexp": "1.7.0",
"@types/react": "16.9.17",
"@types/react-dom": "16.9.4",
Expand Down
8 changes: 5 additions & 3 deletions yarn.lock
Expand Up @@ -5216,11 +5216,13 @@
dependencies:
"@types/node" "*"

"@types/node-fetch@2.3.4":
version "2.3.4"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.3.4.tgz#a46fc4fe9f94b491bf551b6bb7f0f493b9bacd1a"
"@types/node-fetch@2.6.1":
version "2.6.1"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.1.tgz#8f127c50481db65886800ef496f20bbf15518975"
integrity sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==
dependencies:
"@types/node" "*"
form-data "^3.0.0"

"@types/node@*", "@types/node@13.11.0", "@types/node@>= 8":
version "13.11.0"
Expand Down

0 comments on commit 31a538d

Please sign in to comment.