Vscode-eslint: TypeError: Cannot read property 'toLowerCase' of null

Created on 23 Apr 2020  路  6Comments  路  Source: microsoft/vscode-eslint

For a while now eslint fails to start in my vs code and is returning this error:

TypeError: Cannot read property 'toLowerCase' of null
    at Object.e.fromString (/home/killa/.vscode/extensions/dbaeumer.vscode-eslint-2.1.5/client/out/extension.js:1:60516)
    at b.refreshTrace (/home/killa/.vscode/extensions/dbaeumer.vscode-eslint-2.1.5/client/out/extension.js:1:54249)
    at b.initialize (/home/killa/.vscode/extensions/dbaeumer.vscode-eslint-2.1.5/client/out/extension.js:1:46842)
    at /home/killa/.vscode/extensions/dbaeumer.vscode-eslint-2.1.5/client/out/extension.js:1:46447

I did not do any changes, it just started failing. How would I fix it?

bug

Most helpful comment

How does your setting file look like. I guess you have a "eslint.trace.server" setting with a value of null.

All 6 comments

How does your setting file look like. I guess you have a "eslint.trace.server" setting with a value of null.

Allright, I did in fact have this, and when I removed it, this error is no longer occuring. Others are, but this must be after some changes on my side after all, and it looks like eslint 6.8 is acting out.
This looks like I should be able to get it to run from here.

If there is anything I can suggest here, is that the error message could have been clearer on this one. Thank you for your help : )

I should protect the code against null.

Will reopen the issue.

I'm not sure if this is the same issue. Just today, seemingly without any change, linting stopped working. Now I get this output:

Cannot read property 'value' of null Occurred while linting /<FULL PATH>/<FILENAME>.js:<LINE>

It happens for all files. I don't seem to have any nulls in my settings json, so I'm inclined to think it's a different issue. I figured I'd post here in case.

Actually, forget that, turned out it's a deeper issue with (I think) babel-eslint in my case. I just happened to use the same new syntax ?. in multiple open files.

Added code totday that protects against these null cases.

Was this page helpful?
0 / 5 - 0 ratings