Cannot find name 'fetch' Cannot find name 'fetch' reactjs reactjs

Cannot find name 'fetch'


If you are using Typescript 2.8.0+ fetch is included in the standard lib.

You will need to use "--lib dom" or add "dom" in your tsconfig.json:

  1. old ❌
{  "compilerOptions": {    "lib": ["dom"],  }}
  1. new ✅
{  "compilerOptions": {    "lib": ["DOM"],  }}


You most likely will need the typescript typings for fetch, just try

npm install --save-dev @types/whatwg-fetch

should sort out the error your getting.