npmnode.js95% confidence\u2191 254

ESLint: TypeError: this.libOptions.parse is not a function

Full error message
I was getting started with Next.js on WebStorm 2022.2.1 Build #WS-222.3739.57.
I created a new Next.js project with TypeScript enabled, and that's all.

The error is shown below:

TypeError: this.libOptions.parse is not a function

TypeError: this.libOptions.parse is not a function
    at ESLint8Plugin.<anonymous> (C:\Program Files\JetBrains\WebStorm 2022.1.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:139:64)
    at step (C:\Program Files\JetBrains\WebStorm 2022.1.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:44:23)
    at Object.next (C:\Program Files\JetBrains\WebStorm 2022.1.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:25:53)
    at C:\Program Files\JetBrains\WebStorm 2022.1.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:19:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Program Files\JetBrains\WebStorm 2022.1.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:15:12)
    at ESLint8Plugin.invokeESLint (C:\Program Files\JetBrains\WebStorm 2022.1.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:133:16)
    at ESLint8Plugin.<anonymous> (C:\Program Files\JetBrains\WebStorm 2022.1.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:120:44)
    at step (C:\Program Files\JetBrains\WebStorm 2022.1.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:44:23)
    at Object.next (C:\Program Files\JetBrains\WebStorm 2022.1.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:25:53)
Process finished with exit code -1

My Node.js version is v16.15.1, and the ESLint version is 8.23.0.

This is what my devDependencies look like;

  "devDependencies": {
    "@types/node": "18.7.13",
    "@types/react": "18.0.17",
    "@types/react-dom": "18.0.6",
    "eslint": "8.23.0",
    "eslint-config-next": "12.2.5",
    "prisma": "^4.2.1",
    "typescript": "4.8.2"
  }

My .eslintrc.json file:

{
  "extends": "next/core-web-vitals"
}

The issue is tracked at WEB-57089, and it is fixed in 2022.2.2 preview build. The issue is caused by the changes introduced in ESLint 8.23 (offending upstream commit: View on GitHub). Downgrading ESLint to 8.22.x or earlier (with npm install [email protected] --save-exact) should help.

API access

Get this solution programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/error/9702e42a84571e699d9719365270635d9ffa172d8fe040f66204ec2bd9c9ab6e
hash \u00b7 9702e42a84571e699d9719365270635d9ffa172d8fe040f66204ec2bd9c9ab6e
ESLint: TypeError: this.libOptions.parse is not a function — DepScope fix | DepScope