Skip to content
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

"prettier.eslintIntegration": true causes error #96

Closed
AndrewRayCode opened this issue May 1, 2017 · 7 comments
Closed

"prettier.eslintIntegration": true causes error #96

AndrewRayCode opened this issue May 1, 2017 · 7 comments
Labels
bug locked Please open a new issue and fill out the template instead of commenting.

Comments

@AndrewRayCode
Copy link

AndrewRayCode commented May 1, 2017

Format document with "prettier.eslintIntegration": true causes "Path must be a string. Received undefined". I have prettier-eslint installed in my project's node_modules directory.

@CiGit
Copy link
Member

CiGit commented May 1, 2017

Does it happen on every file in your project?
We do not make use of your prettier-eslint. But prettier-eslint will try to use your installed prettier / eslint.

@CiGit CiGit added the bug label May 3, 2017
@Florian-R
Copy link

I can confirm this one. If I try to format with the devtools opened, I've got this error :

[Extension Host] prettier-eslint [ERROR]: eslint fix failed due to an eslint error
d.logExtensionHostMessage @ extensionHost.ts:285
(anonymous) @ extensionHost.ts:139
emitTwo @ events.js:106
emit @ events.js:191
process.nextTick @ internal/child_process.js:752
_combinedTickCallback @ internal/process/next_tick.js:67
_tickCallback @ internal/process/next_tick.js:98

Path must be a string. Received undefined
e.doShow @ messageService.ts:125
e.show @ messageService.ts:104
(anonymous) @ mainThreadMessageService.ts:64
n.Class.derive._oncancel @ winjs.base.raw.js:1638
t.showMessage @ mainThreadMessageService.ts:34
t.$showMessage @ mainThreadMessageService.ts:28
e.handle @ abstractThreadService.ts:34
s @ ipcRemoteCom.ts:275
f @ ipcRemoteCom.ts:231
_combinedTickCallback @ internal/process/next_tick.js:67
_tickCallback @ internal/process/next_tick.js:98

After some digging, I can see, when logging the error here that an error is thrown because of some pathname passed by eslint :

[Extension Host] e TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.extname (path.js:887:5)
    at processText (c:\Users\florian\front\dpi-osiris-angular-ui\node_modules\eslint\lib\cli-engine.js:193:30)
    at CLIEngine.executeOnText (c:\Users\f.revet\workspace\dpi-osiris-angular-ui\node_modules\eslint\lib\cli-engine.js:686:26)
    at eslintFix (C:\Users\f.revet\.vscode\extensions\esbenp.prettier-vscode-0.17.1\node_modules\prettier-eslint\dist\index.js:151:27)
    at format (C:\Users\f.revet\.vscode\extensions\esbenp.prettier-vscode-0.17.1\node_modules\prettier-eslint\dist\index.js:106:10)
    at format (C:\Users\f.revet\.vscode\extensions\esbenp.prettier-vscode-0.17.1\out\src\PrettierEditProvider.js:44:16)
    at PrettierEditProvider.provideDocumentFormattingEdits (C:\Users\f.revet\.vscode\extensions\esbenp.prettier-vscode-0.17.1\out\src\PrettierEditProvider.js:76:76)
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:308630
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:73481
    at new n.Class.derive._oncancel (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:69530)
    at Object.f [as asWinJsPromise] (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:73444)
    at e.provideDocumentFormattingEdits (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:308584)
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:318379
    at t._withAdapter (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:314584)
    at t.$provideDocumentFormattingEdits (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:318341)

Didn't go further but I'm pretty sure this error come from the fact that my current project use an old and incompatible version of eslint (1.10.3, the latest in the 1.X branch FWIW) and this extension try to use the local one.

Not sure about the way to fix that.

@CiGit
Copy link
Member

CiGit commented May 31, 2017

Upgrading eslint fixes it?

@Florian-R
Copy link

Florian-R commented May 31, 2017

Seems to fixes it indeed.

@CiGit
Copy link
Member

CiGit commented Jun 2, 2017

prettier-vscode 0.17.2 upgrades prettier-eslint dependency. Those it fixes this issue?

@Florian-R
Copy link

Just tried with 0.19.0, and everything seems OK. Thanks!

@CiGit CiGit closed this as completed Jun 20, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Apr 13, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

3 participants