-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Prettier fails with Bun workspaces #26265
Comments
|
Do you have a zed/crates/prettier/src/prettier.rs Line 511 in d1c6789
|
After using Bun workspace, only root node_modules exists. In addition, I did not install prettier separately. Because Zed has always automatically installed a copy of prettier globally for formatting code. Strangely, it sometimes works, but for example, when I create a new package in packages, it will fail. When I delete everything in the cache and restart Zed, the automatic format will suddenly work again. |
In my case the logs look like this. Prettier stopped working in any apps or packages of my monorepo (using Turborepo). No amount of reconfiguring Prettier, restarting language servers or Zed itself helps in this instance. Monorepo is using pnpm workspaces.
|
Summary
Prettier path determination fails in Bun workspace monorepo projects, preventing code formatting.
Steps to trigger the problem:
package.json
file at the root with aworkspaces
field defining the workspaces.packages/your-package-name
).index.js
orindex.ts
).Actual Behavior:
Zed displays an error message indicating Prettier path determination failure. The error message is similar to:
The code file is not formatted by Prettier.
Expected Behavior:
The code file within the monorepo package should be automatically formatted by Prettier upon saving or when manually triggered, without any error messages. Prettier should be correctly located and executed within the Bun workspace monorepo environment.
Additional Information:
package.json
file with aworkspaces
field defining the workspaces. Each workspace (package) is located in a subdirectory (e.g.,packages/*
).package.json
file using theworkspaces
field, similar to Yarn or npm workspaces.package.json
: Please see the examplepackage.json
configuration below. This file defines the Bun workspaces using theworkspaces
field..prettierrc.json
,.prettierrc.js
,prettier.config.js
). Please see an example if relevant.settings.json
) that might be relevant to Prettier integration or path detection in monorepo setups? If so, please provide relevant snippets.Zed.log
file for any relevant error details and append them to this report if found.Example
package.json
with Bun Workspaces Configuration:See inside for package.json (Workspaces Example)
The text was updated successfully, but these errors were encountered: