- Instant help with your Developer coding problems

Fix: Prettier stopped working in VS Code

Question:
Why Prettier stopped working in VS Code and how to solve?
Answer:
1. Check the status
2. Check default formatter
3. Check format on save option
Description:

Sometimes Prettier suddenly stops working properly in VS Code. There are several reasons for this. Let's start by going through the possible problems.

Check Prettier status

  • Check Prettier status on the status bar.



  • If there is no such block, then check if the Prettier extension is installed and enabled.
  • If there is a warning sign then click on the Prettier text and it will open the Output panel, where you can see the error message. Maybe your Prettier config file was corrupted.

Check the default formatter

  1. Open settings by pressing CTRL + , or using the menu item File -> Preferences -> Settings
  2. Type default formatter into the search field and check if it is set to Prettier

Alternative:

You can also check if the default formatter is set correctly by simply forcing VSCode to format your code. To do click into the code editor and from the context menu select the Format Document option. If no default formatter is defined you will get a warning dialog:

 Configure Default Formatter Warning

Click on the Configure... button and you can select Prettier from the list:

Select Prettier as default formatter

 

Check Format on save option

  1. Open settings by pressing CTRL + , or using the menu item File -> Preferences -> Settings
  2. Type format on save into the search field and check if it is selected.

 

 

Share "Why Prettier stopped working in VS Code and how to solve?"
Tags:
fix, solve, prettier, format, code, stop, working, formatting, vs code, visual studio code
Technical term:
Prettier stopped working in VS Code