When running prettier from vscode, prettier will throw an error.
WARN Error: path should be a path.relative()d string, but got "............\projects\showtime-manager-module\src\lib\features\toolbar\showtime-manager-toolbar.component.ts"
This happens, on save and when calling 'format document'. Running prettier from the command line works just fine.
prettier should format the file.
The error as seen above
WARN Error: path should be a path.relative()d string, but got "............\projects\showtime-manager-module\src\lib\features\toolbar\showtime-manager-toolbar.component.ts"
at throwErrror
_Feel free to attach a screenshot_.

VS Code Version:
version 1.38.0-insider

Prettier & Prettier Plugin Version:
esbenp.prettier-vscode: 2.2.1
prettier "version": "1.18.2",
Any chance you could provide a sample project that I can use to reproduce this? I am not seeing this error on either my windows or mac.
The problem occurs when the prettierignore file exists within a folder.
I've done a little bit of investigation and created a sample project that reproduces the problem.
prettier-vscode-format-bug.zip
The problem looks to have actually been caused by the recent upgrade to 5.0.0 of the node-ignore package. As per their upgrade docs, a path of the form '../foo' is now considered invalid and throws an error.
When formatting a file, the ignoreFileHandler.ts goes and finds the relative path from the ignore file to the file you're attempting to format. When the prettierignore file is nested inside of some folder, this results in a path like "../file" which is considered invalid by node-ignore and prevents the file from being formatted.
We are no longer using node-ignore in version 3.0 (preview). I have tested out the sample repo and it seems to be working as expected now. You can install the preview version here: https://marketplace.visualstudio.com/items?itemName=Prettier.prettier-vscode
If you are still seeing this issue, please reopen.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
The problem occurs when the prettierignore file exists within a folder.
I've done a little bit of investigation and created a sample project that reproduces the problem.
prettier-vscode-format-bug.zip
The problem looks to have actually been caused by the recent upgrade to 5.0.0 of the node-ignore package. As per their upgrade docs, a path of the form '../foo' is now considered invalid and throws an error.
When formatting a file, the ignoreFileHandler.ts goes and finds the relative path from the ignore file to the file you're attempting to format. When the prettierignore file is nested inside of some folder, this results in a path like "../file" which is considered invalid by node-ignore and prevents the file from being formatted.