Prettier doesn't work whenever i switch folders i'm working on or when i restart VsCode

188 Views Asked by At

I have the prettier extension installed and have had it installed for quite some time, but recently I've been noticing an issue where, whenever i switch which folder i'm working in or whenever i restart VsCode, it stops working and i have to enable and then disable the extension.

I have prettier set as my default formatter.

I apologise if I've left out any important information, if i have done so please do notify me so that i can edit it in.

1

There are 1 best solutions below

1
On BEST ANSWER

Ok so turns out I'm an idiot.

The problem was this: "prettier.resolveGlobalModules": true

This has to be set to false, i cannot stress this enough, do not set it to true.

Correct: "prettier.resolveGlobalModules": false

Wrong: "prettier.resolveGlobalModules": true

I came to this conclusion after resetting every setting and trying it until i found out the reason it didn't work before.