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
[2.5.0-2.6.0] Parsing error: Cannot read property 'parent' of null #1114
Comments
Error is still present with 2.5.0. Changed title to reflect it. |
It's weird - sometimes I can repro this, sometimes I cannot. But I have run into this sometimes in other files. |
I tried to create a minimal repro https://github.com/le0nik/typescript-eslint-parsing-repro and listed steps for reproduction in the README. I can almost consistently reproduce it(sometimes Eslint doesn't give me the error, probably because of an internal error or a race condition inside of it, so I need to rename the variable and save file again for it to work). I've updated the original post with an interesting thing I've found: export const baz1 = () => 'foo'; // no error
export const baz2 = () => {} ; // error!!!
export baz3 = () => ([ // error!!!
{ a: 'b' }, // if you remove this object, the error is gone
]);
export default {}; // error!!! This error only occurs when eslint sees So inititally my assumption that default export didn't trigger the error was wrong. It does happen with default export, too. |
Here's an error stack I've extracted:
So looks like
|
Hmm.. If it's that particular error, it's existed for a while, it's dodgy types. I'll put up a new PR to fix that. Thanks for helping debug this!!! |
Thanks for working on this! |
@bradzacher I don't know if this is related, but I don't feel I have enough to make an issue out of it: I've got a weird somewhat related interminte bug that seems to be related to 2.5.0 as well in IntelliJ, reported here. Heres a recording: This goes away if I don't use 2.5.0, but my brains too fried by some recent long work weeks to do my typical deep dive in trying to nail down a reproduction. I've passed this issue on to a member of the WebStorm team, who might have a better shot at reproducing, but also feel free to @ me w/ instructions on how I could get more info for you :) I'm on Windows 10. |
I am having the same issue, reverting to "@typescript-eslint/parser": "2.4.0" solved it temporarily... |
Same issue as @G-Rath here, downgrading to 2.4.0 worked too although it still seems to break in this fashion on 2.4.0 if the root workspace folder is not the root of my project (where node_modules/eslint settings are). I didn't try to downgrade further as I didn't feel it worth my time. |
I can confirm I have the same issue on my end |
Please try v2.6.0 (released yesterday). |
2.6.0 didn't fix it for me. I've updated repro to use the new version. |
@bradzacher Can we assume the real fix will come with |
#1120 should have fixed the comment parsing code, which I believe was the root cause of this issue. We have an automated release that runs every monday morning and publishes whatever is in master, so that PR will be pushed out as part of the release today (should be 2.6.1, because there were only fix commits since hte last release). |
Cool. Thanks for the clarification on the release process :) |
"npm start" occasionally crashes due eslint failing with the error: Parsing error: Cannot read property 'parent' of null Related to typescript-eslint/typescript-eslint#1114
Repro: https://github.com/le0nik/typescript-eslint-parsing-repro.
There is a problem with
@typescript-eslint/parser
when eslint is executed in IDE/Editor(not in CLI) when you create a new file and add an import/export with curly braces anywhere in it. It triggers the following error:Parsing error: Cannot read property 'parent' of null
.Stack trace:
Affected versions of
@typescript-eslint/parser
: 2.5.0-2.6.0Some examples:
So in summary:
The text was updated successfully, but these errors were encountered: