Prettier external package warning
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
@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
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.
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
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.
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.
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]
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
Yep, agreed. Also coming here as a better auth user btw..
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. π
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.
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
Is there any workarounds for this until it is resolved?
It's making debugging in the console incredibly difficult.
prettier should be a peer dependency and allow any 3.x.x
100% agreed with @davecarlson
@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.
Hi, @gabrielmfern this resurfaced on render version 1.1.2:
./node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@react-email/render/dist/node
Package prettier can't be external
The request prettier/plugins/html matches serverExternalPackages (or the default list).
The request could not be resolved by Node.js from the project directory.
Packages that should be external need to be installed in the project directory, so they can be resolved from the output files.
Try to install it into the project directory by running npm install prettier from the project directory.
Hi, @gabrielmfern sorry to bother you again. Should we create a new issue for this? I am getting the exact same console log as @naquiroz.
same thing