fsouza/prettierd

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object

dkarter opened this issue · 3 comments

There seems to be something either broken or changed in the latest version of prettierd.

Running the following command yields an error:

cat package.json | prettierd package.json
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object

This used to work.

P.S. Thank you for this awesome project! :)

@dkarter hey, this could be related to a change we made in the most recent version. Restarting prettierd should be enough (pkill prettierd and then run it again), but let me know if that doesn't work.

I've been trying to think of way to automatically restart it whenever we update or we first start the server, but I haven't decided on an approach yet (some ideas that I've considered include having a way to ask the server for the version and if they don't match, restart it, alternatively we could have a minimum requirement in the client and use that. Obviously this would only work for versions launched after the mechanism).

Either way, let me know if restarting works for you!

Thank you for the super quick reply @fsouza!
You were correct, I was able to resolve the issue via prettierd restart.

Sounds like a good idea to have the client automatically restart the server when applicable because mostly people run their formatting as a background process and won't necessary know that there's an error otherwise.

Appreciate the help!! ❤️

pkill prettierd seemed to work for me along with restarting neovim. Thanks for fixing this.