Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Cannot read properties of undefined (reading 'type') after esquery updated to 1.4.1 #16900

Closed
1 task
AhmedSaied94 opened this issue Feb 16, 2023 · 1 comment
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly repro:needed

Comments

@AhmedSaied94
Copy link

AhmedSaied94 commented Feb 16, 2023

Environment

Node version: 16.18.0
npm version: 8.19.2
Local ESLint version: 8.31.0
Global ESLint version: 8.31.0
Operating System: github action

What parser are you using?

Default (Espree)

What did you do?

Configuration
{
    "env": {
        "browser": true,
        "es2021": true
    },
    "extends": [
        "eslint:recommended",
        "standard",
        "plugin:react/recommended"
    ],
    "globals": {
        "Atomics": "readonly",
        "SharedArrayBuffer": "readonly"
    },
    "parserOptions": {
        "ecmaFeatures": {
            "jsx": true
        },
        "ecmaVersion": 12,
        "sourceType": "module"
    },
    "plugins": [
        "react",
        "react-hooks"
    ],
}
eslint ./src

What did you expect to happen?

lint the src directory

What actually happened?

Configuration
> frontend_v2@0.1.0 lint
> eslint ./src


Oops! Something went wrong! :(

ESLint: 8.31.0

TypeError: Cannot read properties of undefined (reading 'type')
Occurred while linting /home/runner/work/sm_frontend/sm_frontend/src/App.js:1
    at /home/runner/work/sm_frontend/sm_frontend/node_modules/esquery/dist/esquery.min.js:1:29469
    at /home/runner/work/sm_frontend/sm_frontend/node_modules/esquery/dist/esquery.min.js:1:30512
    at Function.b.matches (/home/runner/work/sm_frontend/sm_frontend/node_modules/esquery/dist/esquery.min.js:1:34848)
    at NodeEventGenerator.applySelector (/home/runner/work/sm_frontend/sm_frontend/node_modules/eslint/lib/linter/node-event-generator.js:296:21)
    at NodeEventGenerator.applySelectors (/home/runner/work/sm_frontend/sm_frontend/node_modules/eslint/lib/linter/node-event-generator.js:324:22)
    at NodeEventGenerator.enterNode (/home/runner/work/sm_frontend/sm_frontend/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
    at CodePathAnalyzer.enterNode (/home/runner/work/sm_frontend/sm_frontend/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:795:23)
    at /home/runner/work/sm_frontend/sm_frontend/node_modules/eslint/lib/linter/linter.js:1150:32
    at Array.forEach (<anonymous>)
    at runRules (/home/runner/work/sm_frontend/sm_frontend/node_modules/eslint/lib/linter/linter.js:1145:15)
Error: Process completed with exit code 2.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

i was be able to fix the problem by downgrading the esquery version to 1.4.0 but be aware to this issue

@AhmedSaied94 AhmedSaied94 added bug ESLint is working incorrectly repro:needed labels Feb 16, 2023
@Rec0iL99
Copy link
Member

Duplicate of #16896

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Aug 16, 2023
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly repro:needed
Projects
Archived in project
Development

No branches or pull requests

2 participants