-
-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extensions does not work with YARN PnP #1502
Comments
This seems to be a bug on Prettier itself. Prettier alone works as expected in both vscode and through the CLI when I use PnP as documented here: https://yarnpkg.com/advanced/editor-sdks#vscode. However, when I install a plugin prettier fails to resolve it in either the CLI or VS Code. Please open a new bug with Prettier directly and reference this issue: https://github.com/prettier/prettier/issues |
For anyone looking for a solution. I found this which helped: |
Yarn pnp now supports this plugin. As @ntotten suggests above visit https://yarnpkg.com/advanced/editor-sdks#vscode for full details. The line you want to run in your terminal inside your project dir is: yarn dlx @yarnpkg/pnpify --sdk vscode This does some magic to tell the prettier-vscode plugin where to find the local prettier module. |
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. |
Summary
Yarn PnP does not have a node_modules in the workspace folder. The extension attempts to do its own resolution to load prettier and its plugins from the workspace in an incompatible way with YARN PnP.
Doing a npm install in the same project to just create a node_modules and populate it fixes the issue for prettier extension. But that is not the point, right :-). Yarn PnP does not need a node_modules.
Steps To Reproduce:
Expected result
No errors and file formatted properly.
Note that prettier from the command line in the same environment with PnP works perfectly fine.
Actual result
The result is:
Additional information
Feel free to attach a screenshot.
VS Code Version: 1.47.3
Prettier Extension Version: v5.1.3
OS and version: Windows 10
The text was updated successfully, but these errors were encountered: