Having a problem with Prettier not being able to format. I have format on save selected, the default format is set to use Prettier. Was working fine yesterday and now it is not formatting on save or when I run the format document command. No settings were changed, I did try uninstalling and reinstalling prettier. Force format document also returns an error.
-
Does this answer your question? [Prettier VSCode JSON Format Error - SyntaxError: ';' expected](https://stackoverflow.com/questions/59664360/prettier-vscode-json-format-error-syntaxerror-expected) – JΛYDΞV Jun 23 '21 at 04:02
-
@JayDev No it does not, I have already found the solution – Blake Jun 23 '21 at 17:22
-
1I am using v8.1 and still experiencing this in some files. – Elias Zamaria Sep 09 '21 at 17:59
3 Answers
v8.0 seems to be broken, the solution was to downgrade to v7.1.1.
Found out there were issues here: https://github.com/prettier/prettier-vscode/issues/2029
EDIT: v8.1 is out and the issue is now fixed.

- 186
- 1
- 12
In my case, it was because the prettier setting Prettier:enable
was not turned on after the extension installed (finally found this after some time wondering why...).
To check go to File->preferences->settings and then type prettier
and scroll down until you see Prettier:enable
and make sure it is checked.
(In case you wonder, I figured this out when I look at the output of the prettier console)

- 31
- 1
- 4
You are probably using v8.0 of the Prettier extension for VS Code. Updating the extension to v8.1, where the issue is fixed, will solve your problem:
- Find the "Prettier - Code Formatter" extension in your list of extensions in VS Code.
- Press the "Update" button next to the extension.
Some people have had issues just updating, so alternatively you can uninstall then reinstall the Prettier extension.

- 75
- 1
- 9