prettierd
prettierd copied to clipboard
1488
Worked fine until the moment when it started to produce � in random places. On every save it adds �� to the same place (start of the 1488 line).
Using lazy.nvim with null-ls. Plugin is installed via Mason.
FIle encoding is utf-8.
Using cyrillic characters.
Working on WSL2 Ubuntu.
Isn't reproducing with prettier.
Can you reproduce when running prettierd on the command line?
Yes
cat src/dict/index.ts | prettierd src/dict/index.ts:
I forgot to mention, this file is in .prettierignore. But excluding it from there does not help (formats, but produces �).
can you run prettierd --debug-info src/dict/index.ts?
Also is that code open source? If so, can you link it? If not, can you share a snippet of it with the cyrillic characters? I'll try to repro
Yes, it's open source, here's the repo
$ prettierd --debug-info src/dict/index.ts
prettierd 0.25.2
prettier version: 3.1.1
Loaded from: /home/gooseob/projects/taraskevizer/node_modules/prettier/index.cjs
It's the same situation for Japanese characters, can reproduce with prettierd, but cannot reproduce with prettier
Thanks for the added details. Can you try the latest release?
Unfortunately, after upgrading to 0.25.3 the issue still exists for me :(
Prettier version in mason:
Diff after running prettierd formatting
Thanks for confirming! I'll keep digging into it.
The bug seems similar to GooseOb/taraskevizer#5. So there might be a problem with node. I tried with bun and it works fine, so I opened nodejs/node#52944
Oh, I see you changed the implementation of get-stdin and I do not see the bug now. Seems like it helped
No, it didn't, I still get this characters :)
Any fix?
The fix is in these 2 PRs: https://github.com/mantoni/core_d.js/pull/32 and https://github.com/fsouza/prettierd/pull/917.
As it's hard to know when both will be merged and released I've published fixed versions in npm as @powerman-asdf/core_d and @powerman-asdf/prettierd.