Vscode-eslint: Git window: "Error: Path must be a string. Received undefined"

Created on 19 Dec 2016  路  20Comments  路  Source: microsoft/vscode-eslint

As a user, when I have ESLint installed, and I modify a JS file, and I navigate to the Git window, and I select a JS file, I see the following error:

"Path must be a string. Received undefined"

Screenshot:

screenshot 2016-12-19 12 03 52

needs more info

Most helpful comment

I am getting this same error with eslint v3.16.0 so maybe they broke it again?

All 20 comments

@brianegan I can't reproduce this using the latest version of ESLint. Which version of ESLint are you using? Node changed the path API to throw if args aren't strings and this requires to uses the latest version of the ESLint module.

I can confirm the error in "eslint": "^1.10.3". Fixed in "eslint": "3.12.2".

@brianegan objection to close the issue?

I am getting this same error with eslint v3.16.0 so maybe they broke it again?

@dbaeumer I disabled ESLint 1.2.6 and issue doesn't appear on VS Code Insiders (v1.10.0-insider)

I am getting this same error and I disabled eslint plugin then error does't appear.
qq 20170225015342

@jiqiangbing, @jungchris which version of the eslint npm package are you using?

I tried this again today and I can't reproduce this. Can someone share a GitHub repository that I can clone that reveals the problem?

@dbaeumer v3.16.1. And when I click a js file in the SCM panel could probably cause this problem (see the screenshot above). But I also encounter such problem in the explorer panel when I use eslint plugin in a big project.
the .eslintrc is https://gist.github.com/jiqiangbing/cdfd7f8c51487c66e9998cf7857106f6

I am on ubuntu 16.04, eslint v3.16.0, node 6.9.2

image

OK. I fixed the problem with the git index file by not validating them. However I would be interested in a reproducible case for seeing this when opeing a file from the explorer. @jiqiangbing could you provide such a case.

I got it, my project's package.json had "eslint": "^1.10.3". When I upgrade it to 3.16.1, problem sloved which encountered in explorer.

@jiqiangbing cool. I will close the issue then.

Still face this issue for

eslint 3.16.1
vscode 1.10.2
npm 4.0.5
node 7.4.0

image

@ta-run can you share your project so that I can investigate.

I have the same problem every time I open the Git Diff window. Is there a way to exclude git diffs from the validation?

^ i am having the same problem as @erlethor. i get this error every time I open the Diff window, on any project I am working on.

@erlethor @pgraci published 1.2.8 today which should disable all validation of git diff windows.

@dbaeumer can't share the project as it's a corporate one.
But error's gone after today's update. Thanks :)

Thanks for the quick fix! It worked well.

Was this page helpful?
0 / 5 - 0 ratings