Currently starting up the server on my client side, the error above is what I have been getting. I am using Typescript, React, ESlint. I can\'t seem to go forward since th
Sometimes this error is a result of an invalid type as others have stated
I've gotten this error when using a bare array as a type
const someVariable: [] //Incorrect
const someVariable: string[] //Correct
I also got this error when typing an multidimensional array incorrectly:
const someVariable : [string[]] //Incorrect. Results in map error
const someVariable : string[][] //Correct
The error message from typescript is pretty cryptic so hopefully this helps.
Yarn users, I had the same problem in react, I solved the problem remove package.json and install again:
rm -rf node_modules
yarn cache clean
yarn install
I'd made with vscode closed by linux terminal, to don't have problem with cache.
As @mohammadreza berneti mentioned, deleted node_modules/.cache
helped in my case (an nothing else needed)
This is what worked for my CRA project.
Step 1: edit package.json
and set typescript
version to ^3.9.7
Step 2: delete .cache
folder in node_modules
Step 3: run npm install
Your version of TypeScript is not compatible with your eslint. You can fix it by upgrading these two dependencies to the latest version. Version 4.6.0 is compatible with TypeScript 4.0.5
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
}