Skip to content

Prettier external package warning #1993

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
yusifaliyevpro opened this issue Mar 27, 2025 · 15 comments
Closed

Prettier external package warning #1993

yusifaliyevpro opened this issue Mar 27, 2025 · 15 comments
Labels
Type: Bug Confirmed bug

Comments

@yusifaliyevpro
Copy link

Describe the Bug

Hello, I am facing a warning today. I tried to reinstall all packages but it didn't work. I am working with a NextJS 15 project. My pnpm version is 10.7.0

⚠ ./node_modules/.pnpm/@[email protected]_r_54ba43e403e223a8326dd018c58af3ee/node_modules/@react-email/render/dist/node
Package prettier can't be external
The request prettier/standalone matches serverExternalPackages (or the default list).
The package resolves to a different version when requested from the project directory (3.5.3) compared to the package requested from the importing module (3.4.2).
Make sure to install the same version of the package in both locations.

Which package is affected (leave empty if unsure)

react-email

Link to the code that reproduces this issue

It is private repo

To Reproduce

It is a package dependency problem

Expected Behavior

There must be no warning

What's your node version? (if relevant)

v22.13.1

@yusifaliyevpro yusifaliyevpro added the Type: Bug Confirmed bug label Mar 27, 2025
@CHC383
Copy link
Contributor

CHC383 commented Mar 27, 2025

@react-email/render depends on prettier v3.4.2 and your repo depends on 3.5.3, so there is a conflict and you could override it in your package.json

"pnpm": {
    "overrides": {
      "prettier": "^3.5.3"
    }
}

I think it would be better to loosen the prettier version here, use ^3 or ^3.x.x (if there is a known minimum version), as this compatibility issue has come up a few times

@angelod1as
Copy link

In my case, I don't use prettier on my project, so pnpm add prettier doesn't solve it. I had to pnpm add [email protected] to solve it entirely.

@davecarlson
Copy link

I'm not sure prettier should really even be a dependancy for the release?

For the people maintaining this package, sure, but not if you are npm'ing

@daveycodez
Copy link

daveycodez commented Mar 31, 2025

Hey guys, let's not bundle prettier. Make it a devDependency. It's super messy having to put an override or have to adjust the prettier version to match react-email.

@CHC383
Copy link
Contributor

CHC383 commented Mar 31, 2025

Unfortunately prettier is indeed a dependency for @react-email/render, as it is used in the code. A potential workaround is to unpin the specific version, but it could still cause conflicts in some cases.

@gruz0
Copy link

gruz0 commented Apr 2, 2025

Same issue here.

 ⚠ ./node_modules/@react-email/render/dist/node
Package prettier can't be external
The request prettier/standalone matches serverExternalPackages (or the default list).
The package resolves to a different version when requested from the project directory (3.5.3) compared to the package requested from the importing module (3.4.2).
Make sure to install the same version of the package in both locations.
$ npm ls prettier
[email protected] /home/alexkadyrov/Projects/custdev
├─┬ [email protected]
│ └── [email protected] deduped
├── [email protected]
└─┬ [email protected]
  └─┬ @react-email/[email protected]
    └── [email protected]

@daveycodez
Copy link

daveycodez commented Apr 2, 2025

Hey guys delete prettier and switch to Biome plz. Having to put an override for prettier in a package.json for all consumers of my package is very unwieldly.

I will have to update the instructions at https://better-auth-ui.com to tell every dev that they have to run pnpm install prettier manually and then add an override? That's way too much overhead

@wottpal
Copy link

wottpal commented Apr 3, 2025

Yep, agreed. Also coming here as a better auth user btw..

@yusifaliyevpro
Copy link
Author

yusifaliyevpro commented Apr 3, 2025

I explored better-auth.ui right now. Great and usefull project👍✨. Really useful, and I’ll definitely be using it in my new projects.

But The react-email should change their version of prettier. While this doesn’t cause errors, pinning package versions isn’t generally a best practice. Using a version range like "^3.4.2" would be more flexible and help avoid unnecessary warnings in the terminal and package sizes as said in the #2026 .

I saw in #2026 that the team is already discussing this, so I’m hopeful it will be updated soon. 🙏

@edwardrpool
Copy link

I just ran into this save issue when trying to implement Resend as a transactional email replacement. Resend seems pretty solid, however the pinned dependencies are killing the project. Hoping it's resolved quickly.

@davecarlson
Copy link

davecarlson commented Apr 4, 2025

As previously mentioned, I personally understand why prettier is a dep, not a devDep, but the vast majority of people will not want this, as it is going to massively inflate their bundles. We really shouldnt be using dev tooling like this.

It doesnt help that the resend package includes this no matter what - we have requirement to ship react based emails, just transactional ones, this really should be a separate "opt in" if you are using it

@SimtecConsult
Copy link

Is there any workarounds for this until it is resolved?

It's making debugging in the console incredibly difficult.

@capaj
Copy link

capaj commented Apr 15, 2025

prettier should be a peer dependency and allow any 3.x.x

@wottpal
Copy link

wottpal commented Apr 15, 2025

100% agreed with @davecarlson

@resend resend deleted a comment from davecarlson Apr 16, 2025
@gabrielmfern
Copy link
Collaborator

@react-email/render 1.0.6/@react-email/components 0.0.36 have this fixed, and we have already unpinned our dependencies in canary coming soon to the latest releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Confirmed bug
Projects
None yet
Development

No branches or pull requests