Skip to content

TypeError: Cannot read property 'loc' of undefined #1759

Closed
@franckl

Description

I am using Eslint in webstorm (an IDE) and I get this error.
Eslint works on the js files that contain my node/express code but not on my client side js file

Any idea what is causing this issue or how I could debug it ?

/usr/local/lib/node_modules/eslint/lib/eslint.js:693
            location = node.loc.start;
                           ^
TypeError: Cannot read property 'loc' of undefined
    at EventEmitter.module.exports.api.report (/usr/local/lib/node_modules/eslint/lib/eslint.js:693:28)
    at RuleContext.report (/usr/local/lib/node_modules/eslint/lib/rule-context.js:93:16)
    at /usr/local/lib/node_modules/eslint/lib/rules/no-shadow.js:38:25
    at Array.forEach (native)
    at checkShadowsInScope (/usr/local/lib/node_modules/eslint/lib/rules/no-shadow.js:36:19)
    at EventEmitter.checkForShadows (/usr/local/lib/node_modules/eslint/lib/rules/no-shadow.js:54:13)
    at EventEmitter.emit (events.js:117:20)
    at Controller.controller.traverse.enter (/usr/local/lib/node_modules/eslint/lib/eslint.js:646:25)
    at Controller.__execute (/usr/local/lib/node_modules/eslint/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/usr/local/lib/node_modules/eslint/node_modules/estraverse/estraverse.js:495:28)
    at EventEmitter.module.exports.api.verify (/usr/local/lib/node_modules/eslint/lib/eslint.js:639:24)

Process finished with exit code 8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyruleRelates to ESLint's core rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions