Prettier does not work as default formatter in VS Code 1.57.1 on Windows.
See original GitHub issueSummary
I have the Prettier extension installed, have the prettier npm package installed globally and in this project. It seems as though the Prettier extension is not starting and is missing in the VS Code status bar.
When I try to save a file that I know to have no errors, I get the error "Extension 'Prettier - Code fromatter' cannot format 'src\index.js'"
My relevant settings:
{
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
Manually formatting doesn’t work either. Running prettier in the command line does correctly format the file.
Short summary of what is going on or to provide context.
It works fine on my Mac. Both VS Code installations are fine and settings are synced.
Github Repository to Reproduce Issue
Link to a Github repo that can be used to reproduce the issue.
Steps To Reproduce:
- Install Prettier extension
- Try to save a file
- Alternatively, try to format manually.
Expected result
The file should have been formatted upon saving it.
Actual result
I get the error "Extension 'Prettier - Code fromatter' cannot format 'src\index.js'"
Additional information
Feel free to attach a screenshot.
VS Code Version:
Version: 1.57.1 (user setup) Commit: 507ce72a4466fbb27b715c3722558bb15afa9f48 Date: 2021-06-17T13:28:07.755Z Electron: 12.0.7 Chrome: 89.0.4389.128 Node.js: 14.16.0 V8: 8.9.255.25-electron.0 OS: Windows_NT x64 10.0.18363
Prettier Extension Version: 8.0.1
Prettier Log Output
Cannot create log output, because Prettier is missing from the toolbar.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:19 (4 by maintainers)
Top GitHub Comments
okay after i updated my vscode to latest version, prettier stopped working i got the following message when i save a file at the bottom left: “prettier was unable to format /…/…/…/”
so after disable prettier and enable it again i set it as the default formatter and now its working correctly but i don’t know what happened exactly my vscode theme was reset to the default
vscode version:
1.57.1
Having the same issue on a Mac