-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
ESLint: Cannot read property 'loc' of undefined. Please see the 'ESLint' output channel for details. #441
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
Comments
I am unable to repro this against master. I'm not sure what eslint version you have installed, because your provided stack trace lists indent.js:1361 as the source of the Please do the following things to help debug:
|
This comment has been minimized.
This comment has been minimized.
You need to run the package locally instead of globally: If you run it globally ( |
Can you save that code when it breaks and then run eslint with the - - debug flag? The screenshot of the vscode bug toast isn't all that helpful. |
Sure.
|
awesome, thanks. I'm in the middle of the rewrite, of the indent rule which should fix issues like this. |
This comment has been minimized.
This comment has been minimized.
@bradzacher How long to wait for that fix? |
Like I said, I'm in the middle of a rewrite to handle all of these cases properly. It's going to be a while as indent is a huge rule. |
@bradzacher any recommendations on workaround while rewrite is in flight? |
Here's a repro repo. Please fix it, thanks! |
We’ve been discussing if we want to add the ability to handle recoverable errors in ESLint core. This type of error was actually one of the concerns that was brought up during that discussion. See eslint/rfcs#19 for more details. |
Same problem here, is there any workaround? This is the only reason that makes me not use ESLint in a typescript team project. |
@2alin - what is your repro case for "the same problem"? Is it exactly the same problem as one of the ones? If not then please elaborate with a repro. If it's an error that's only showing up within your IDE, then just ignore the error and the eslint extension will recover as soon as you save the file again. If the issue persists through file saves, then it's probably not a semantically invalid file, and might be a bug in a rule. Try doing a CLI run to see if that errors in the same way. If it's an error that occurs during a CLI run, then please, please, please comment with the output of running your eslint command with the this debug log #441 (comment) and this repro #441 (comment) is an issue with the indent rule caused by linting an incomplete variable declaration (i.e they attempted to lint Your use case might be different. I don't know - I don't have your codebase. Help me to help you. |
@bradzacher Thanks for being on top of it. The issue for me is not that IDE will not recover or it shows up during CLI run. It's just when I type I bet your PR is going to fix it as it's on |
please open a new issue and fill out the details. |
What code were you trying to parse?
What did you expect to happen?
No Error
What actually happened?
ESLint: Cannot read property 'loc' of undefined. Please see the 'ESLint' output channel for details.
when I write const in tsx, ESlint send an errror.
my eslint.js:
Versions
@typescript-eslint/parser
1.6.0
TypeScript
3.3.3333
ESLint
create-react-app default
node
11.10.0
npm
6.8.0
The text was updated successfully, but these errors were encountered: