Closed derakhshanfar closed 5 years ago
In the meantime, installing prettier-vscode
1.7.3 fixed the issue for me on vscode
1.30.2
Seems the same as #705 which was fixed with https://github.com/prettier/prettier-vscode/pull/706.
@colinrcummings updating to 1.8.1 should work as well
@kristianmitk, for me 1.8.1 fails to format without any output; 1.8.0 fails to format along with the output Couldn't resolve parser "babel"
.
Could you share your setup?
No errors in the dev console? Your settings seem fine.
@colinrcummings What is your local version of Prettier in the repo?
@CiGit, there is; after saving a file that requires formatting:
ERR prettierInstance.getSupportInfo is not a function: TypeError: prettierInstance.getSupportInfo is not a function
at getSupportLanguages (/Users/ccummin3/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/utils.js:43:29)
at Object.getParsersFromLanguageId (/Users/ccummin3/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/utils.js:11:22)
at /Users/ccummin3/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:46:40
at Generator.next (<anonymous>)
at __awaiter (/Users/ccummin3/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:7:71)
at new Promise (<anonymous>)
at __awaiter (/Users/ccummin3/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:3:12)
at format (/Users/ccummin3/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:40:12)
at PrettierEditProvider._provideEdits (/Users/ccummin3/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:158:16)
at PrettierEditProvider.provideDocumentFormattingEdits (/Users/ccummin3/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:152:21)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:557:303
at t.asThenable (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:141:941)
at new Promise (<anonymous>)
at Object.t.asThenable (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:141:909)
at e.provideDocumentFormattingEdits (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:557:262)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:572:705
at e._withAdapter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:567:513)
at e.$provideDocumentFormattingEdits (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:572:667)
at t._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:658:837)
at t._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:658:509)
at t._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:657:60)
at t._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:656:59)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:653:895
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:130:793
at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:133:218)
at a (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:186:147)
at Socket.n._socketDataListener (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:186:368)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at Pipe.onread (net.js:594:20)
@jhiker, the prettier
version in the project I'm working in this morning is 1.7.0.
@colinrcummings, thought as much. The fix in https://github.com/prettier/prettier-vscode/pull/706#discussion_r252837934 only fixed support for > 1.8.0.
https://github.com/prettier/prettier-vscode/pull/707 is outstanding, but depends on an upstream change to Prettier. If upgrading your version of Prettier is an option, I'd probably recommend that
Ow that was fast ... The current solution is to use prettier-vscode < 1.8 or to upgrade prettier >= 1.8
Both versions matching is not intended
@JHilker & @CiGit thanks for the info. Is there an issue or pr in prettier for the upstream change I can watch?
@colinrcummings I created a more detailed (and searchable) issue in this repo: https://github.com/prettier/prettier-vscode/issues/710
The upstream issue in Prettier is https://github.com/prettier/prettier/issues/5822
Ok, this was faster than expected (I'm joining you @JHilker on faith and deps)
I think the original issue (title is a bit vague) is not about that. 2 days ago this wasn't a thing.
@derakhshanfar can you share a repository ?
I'm experiencing this since yesterday with this setup:
VSCode: Version 1.33.0-insider (1.33.0-insider) Plugin: esbenp.prettier-vscode 1.8.0 Package: "prettier": "^1.16.4", "typescript-tslint-plugin": "^0.3.1",
@colinrcummings I'm also reproducing this issue on the latest Insiders build. I confirmed that it doesn't repro in the latest production version.
Yup, I am experiencing it as well. I guess this is what you get for using insiders build :(
@krzkaczor Just updated VS Code (for today's update), and it seems to be working. Can you give it a try and confirm?
@martellaj oh, it updated twice in a row and now it works again 😆 thanks for this tip.
Fixed !
Great, thanks @CiGit!
Could you please publish a new release?
For me this was broken in 1.34.0
and I tracked it down to config.json:
"prettier.eslintIntegration": true,
When I removed this everything worked again.
Thanks, @klippx , that turned out to be my issue too!
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.
Using the format command "Shift + Alt + F" doesn't format the file with prettier, use VS default parameters but if i run with CLI like this, it works
vs code: 1.30.2