Skip to content

Error in VSCode when extending eslint-config-react-app: "The "id" argument must be of type string. Received undefined" #12084

Closed
@thisismydesign

Description

@thisismydesign

Describe the bug

I'm trying to extend react-app eslint rules in my project, however when doing so the VSCode integration breaks.

.eslintrc

module.exports = {
  extends: [
    "react-app",
    ...
  ],

Output of ESLint logs:

[Error - 10:06:24 AM] Request textDocument/codeAction failed.
  Message: Request textDocument/codeAction failed with message: Cannot read config file: /root/workspace/c-hive/cra-typescript-starter/node_modules/eslint-config-react-app/base.js
Error: The "id" argument must be of type string. Received undefined
Referenced from: /root/workspace/c-hive/cra-typescript-starter/node_modules/eslint-config-react-app/index.js
  Code: -32603 
(node:27078) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received undefined
    at validateString (internal/validators.js:124:11)
    at Module.require (internal/modules/cjs/loader.js:945:3)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/root/workspace/c-hive/cra-typescript-starter/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js:163:26)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
(node:27078) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 282)

If I remove react-app from the extends array it works fine.

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

Searched for the error

Environment

Environment Info:

  current version of create-react-app: 5.0.0
  running from /root/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app

  System:
    OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
  Binaries:
    Node: 16.10.0 - ~/.nvm/versions/node/v16.10.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.10.0/bin/yarn
    npm: 7.24.0 - ~/.nvm/versions/node/v16.10.0/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    react: ^17.0.2 => 17.0.2 
    react-dom: ^17.0.2 => 17.0.2 
    react-scripts: 5.0.0 => 5.0.0 
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. Check out thisismydesign/cra-typescript-starter@82f86cc
  2. Open in VSCode with ESLint extension installed
  3. Check ESLint console output

Expected behavior

No error

Actual behavior

Error

image

Reproducible demo

thisismydesign/cra-typescript-starter@82f86cc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions