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

"Cannot read property 'type' of undefined" when updating to version 4.14.0 #9773

Closed
bary12 opened this issue Dec 25, 2017 · 1 comment
Closed
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon

Comments

@bary12
Copy link

bary12 commented Dec 25, 2017

Tell us about your environment

  • ESLint Version: 4.14.0, The error did not occur in 4.13.1
  • Node Version: 6.10.4
  • npm Version: 5.5.1

What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint

Please show your full configuration:

See eslint-config-canonical

Configuration
{
  "extends": "canonical",
  "root": true,
  "rules": {
    "filenames/match-regex": 0
  }
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

This was caused by a certain file, I don't know which part of the file, but the problem seems to be there. See the source code of the file.

./node_modules/.bin/eslint ./src ./test

This seems to have happened in particular on the file mentioned above,

./node_modules/.bin/eslint ./src/rules/checkParamNames.js

What actually happened? Please include the actual, raw output from ESLint.
ESlint crashed with the following error:

Cannot read property 'type' of undefined
TypeError: Cannot read property 'type' of undefined
    at isForInRef (/home/travis/build/gajus/eslint-plugin-jsdoc/node_modules/eslint/lib/rules/no-unused-vars.js:410:24)
    at variable.references.some.ref (/home/travis/build/gajus/eslint-plugin-jsdoc/node_modules/eslint/lib/rules/no-unused-vars.js:447:21)
    at Array.some (<anonymous>)
    at isUsedVariable (/home/travis/build/gajus/eslint-plugin-jsdoc/node_modules/eslint/lib/rules/no-unused-vars.js:446:40)
    at collectUnusedVariables (/home/travis/build/gajus/eslint-plugin-jsdoc/node_modules/eslint/lib/rules/no-unused-vars.js:569:26)
    at Program:exit (/home/travis/build/gajus/eslint-plugin-jsdoc/node_modules/eslint/lib/rules/no-unused-vars.js:621:36)
    at listeners.(anonymous function).forEach.listener (/home/travis/build/gajus/eslint-plugin-jsdoc/node_modules/eslint/lib/util/safe-emitter.js:47:58)
    at Array.forEach (<anonymous>)
    at Object.emit (/home/travis/build/gajus/eslint-plugin-jsdoc/node_modules/eslint/lib/util/safe-emitter.js:47:38)
    at NodeEventGenerator.applySelector (/home/travis/build/gajus/eslint-plugin-jsdoc/node_modules/eslint/lib/util/node-event-generator.js:251:26)

Note that here eslint-plugin-jsdoc is the repository being linted.

This did not occur with eslint@4.7.2

EDIT: Now also checked with version 4.13.1 and the error does not occur. Seems to be a problem specifically with 4.14.0

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Dec 25, 2017
@bary12
Copy link
Author

bary12 commented Dec 25, 2017

Duplicate of #9767, #9762

@bary12 bary12 closed this as completed Dec 25, 2017
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jun 24, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jun 24, 2018
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 triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

1 participant