You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[regression] v10.59.0 causes vite@6 to be installed #21669
mkdir sentry-vite
cd sentry-vite
npm init -y
npm i @sentry/node vitest
npm ls vite
Expected Result
Avoid forcing old major version of vite (two majors behind) to get installed
Actual Result
vite@6 is forced. in newer setups, causes two versions of vite to get installed.
Additional Context
This is a regression of 10.59.0
10.58.0 allowed vite@8 to get installed alongside it.
Saw this in two projects already.
Happens because of the peer dependency added to @sentry/server-utils:
doesn't matter that it's optional. if a project already has uses vite, this will affect the resolution of the versions (either cause a duplicate or force the old version)
example for the duplicate:
mkdir sentry-vite
cd sentry-vite
npm init -y
npm i vite@8 @sentry/node vitest
npm ls vite
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
TIL: npm installs matching versions of an optional peer dep, if the dependency is installed but not in a matching version range for the optional peer dep. So in your repro, vite@8 gets installed. Upon installation of the @sentry/server-utils package, npm sees that vite is installed but Sentry's version range requires a lower vite version (@6). Since the peer dep is optional, NPM doesn't fail the installation. Because it is installed but in a non-matching version, npm also installs the matching version. Not very intuitive behaviour but clankers keep telling me this is beneficial lol.
I think we could fix this with only declaring a minimal vite dep (i.e. leaving the max. version open ended), by declaring all supported majors explicitly, or by removing the peer dep entirely. I'm tending towards removing it but I'll discuss this with the team first. Thanks for raising!
Activity
linear-code commentedon Jun 20, 2026
JS-2814
AviVahl commentedon Jun 20, 2026
FYI @mydea @isaacs
I believe this regressed with #20900
Lms24 commentedon Jun 22, 2026
Thanks for writing in! Gonna take a look :)
Lms24 commentedon Jun 22, 2026
TIL: npm installs matching versions of an optional peer dep, if the dependency is installed but not in a matching version range for the optional peer dep. So in your repro,
vite@8gets installed. Upon installation of the@sentry/server-utilspackage, npm sees that vite is installed but Sentry's version range requires a lower vite version (@6). Since the peer dep is optional, NPM doesn't fail the installation. Because it is installed but in a non-matching version, npm also installs the matching version. Not very intuitive behaviour but clankers keep telling me this is beneficial lol.I think we could fix this with only declaring a minimal vite dep (i.e. leaving the max. version open ended), by declaring all supported majors explicitly, or by removing the peer dep entirely. I'm tending towards removing it but I'll discuss this with the team first. Thanks for raising!
fix(server-utils): Remove optional `vite` peer dependency (#21677)
AviVahl commentedon Jun 22, 2026
Thank you for addressing this. 🙏 We're awaiting the next version to upgrade.
github-actions commentedon Jun 23, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #21677, which was included in the 10.60.0 release.