prettierd icon indicating copy to clipboard operation
prettierd copied to clipboard

Prettierd requires manual restart when prettier version changes

Open sarmong opened this issue 3 years ago • 1 comments

When I update prettier version in my repo, I need to manually kill prettierd process to have it use the new version.

Would be nice if it could detect that the version loaded in cache is not the same as the installed.

Or at least, document this. Because it is not obvious

Steps to reproduce

  1. npm i -D [email protected]
  2. See that prettierd uses this version to format
  3. npm i -D [email protected]
  4. npx prettier -c [file]
  5. There should be warning if you have things that are formatted differently in 2.3
  6. prettierd doesn't format with 2.3 even when you restart neovim
  7. killall prettierd
  8. Now it formats correctly

sarmong avatar Jan 07 '22 08:01 sarmong

Still not sure what's the best way to detect a change, but 0.20.0 at least includes a command to clear the cache (prettierd flush-cache), so you won't need to restart anymore.

fsouza avatar Apr 10 '22 21:04 fsouza

Restarting with prettierd restart did not work for me. I really needed to flush-cache and restart to make the changes apply. Thanks @fsouza for pointing this out.

uloco avatar Mar 06 '23 11:03 uloco