0

I'd like to understand why is this happening...

Using VS Code and dev container, I was having a frozen container at 100% CPU usage after a few minutes, and noticed it came from the Prettier extension. Prettier was pretty slow (around 500 ms on my small test file), and ended up to be completely stuck.

Then, I found a clue on this issue: enter image description here

I decided to give it a try, set the prettierPath to another path and bingo: 60 ms execution time, and no more CPU usage. The thing is...this path is wrong and does not exist, as written in the logs:

["ERROR" - 9:20:01 AM] Error loading node module '/workspaces/ppw/fake path'
["ERROR" - 9:20:01 AM] Cannot find module '/workspaces/ppw/fake path'

So the question is: how come providing a wrong parameter may have been a solution to my issue? Which prettier is eventually used? What should I do exactly to have a clean and consistent configuration?

David Dahan
  • 10,576
  • 11
  • 64
  • 137
  • https://meta.stackoverflow.com/a/285557/11107541 your screenshot isn't code, but it still shouldn't be a screenshot. use a blockquote and link to the profile of the user you're quoting and link to the quoted comment. – starball Apr 21 '23 at 09:45
  • When I enable debug logs I see the following when putting a wrong path for the module: `["DEBUG" - 3:04:51 PM] Using bundled version of prettier.`, so that's probably what is helping. – beeb May 02 '23 at 13:05

0 Answers0