Skip to content

Prettier 3.0.0 peer dependency compatibility issue #376

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

Closed
annaghi opened this issue Jul 10, 2023 · 3 comments
Closed

Prettier 3.0.0 peer dependency compatibility issue #376

annaghi opened this issue Jul 10, 2023 · 3 comments

Comments

@annaghi
Copy link

annaghi commented Jul 10, 2023

Describe the bug
When installing the latest version of prettier-plugin-svelte with the latest version of Prettier (3.0.0), npm throws an error due to the peerDependencies of prettier in the package.json file. The peerDependencies are currently specified as ^1.16.4 || ^2.0.0, which doesn't cover Prettier 3.0.0.

To Reproduce
Steps to reproduce the behavior:

  1. Use a project with the latest version of prettier (3.0.0).
  2. Install prettier-plugin-svelte version 2.10.1.
  3. Run npm i to install the dependencies.
  4. See error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/prettier
npm ERR!   dev prettier@"^3.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer prettier@"^1.16.4 || ^2.0.0" from [email protected]
npm ERR! node_modules/prettier-plugin-svelte
npm ERR!   dev prettier-plugin-svelte@"^2.10.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /home/anna/.npm/_logs/2023-07-10T05_05_59_696Z-eresolve-report.txt

Expected behavior
prettier-plugin-svelte should install without errors when the latest version of Prettier is used.

Suggested Solution
It might be sufficient to update the peerDependencies to include ^3.0.0 for prettier. However, I'm not sure if this is as simple as changing the version number in peerDependencies or if additional testing with Prettier 3.0.0 is needed to ensure compatibility.

Thank you for your attention to this matter!

@Nyaacinth
Copy link

Nyaacinth commented Jul 10, 2023

This plugin is incompatible with Prettier 3 for now because of the breaking changes around the plugin interface, so the the information in peerDeps is actually correct. 🙂

Related to #365

@annaghi
Copy link
Author

annaghi commented Jul 10, 2023

Thank you for the prompt response, and I apologize for not having checked the PRs earlier.
I appreciate your work on this plugin!

@dummdidumm
Copy link
Member

Closing as duplicate of #317

@dummdidumm dummdidumm closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants