Repository navigation
fix(deps): Let the host own nitro and @sentry/junior - #2403
Merged
Merged
Conversation
The dashboard listed @sentry/junior and nitro as dependencies. A host on a different nitro version got a second copy of @sentry/junior for the dashboard, with an empty plugin registry. Use the host's copy instead, and keep nitro for the build test only. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Sentry Evalsjunior-behavioral
Base commit junior-integration
Base commit |
Member
|
wait is that how its actually supposed to be done? does that mean all our plugins should use peer deps? thats confusing |
Core imports nitro types and wraps the host Nitro build, but it got nitro only as a peer of @sentry/nitro. List the Nitro versions that build the example app as a direct peer, so the host owns one Nitro version and pnpm warns when it is out of range.
dcramer
approved these changes
Oct 30, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows getsentry/junior-prod#574.
Cause
@sentry/junior-dashboardlisted@sentry/junior(published as an exact version) andnitro: 3.0.260522-betaindependencies. The dashboard never importsnitro.@sentry/juniorgotnitroonly as a peer of@sentry/nitro. junior-prod pinned[email protected], so pnpm installed@sentry/juniortwice: one copy with the host's nitro, and one with the dashboard's nitro.createApp({ plugins })filled the plugin registry of the host copy. The dashboard read@sentry/junior/apifrom its own copy, where the registry was empty. Every plugin automation then showed "The plugin for this source is not enabled."Change
@sentry/junior-dashboard:@sentry/juniormoves topeerDependencies, so the dashboard uses the core copy that the host installs.nitromoves todevDependencies, because onlytests/dashboard-output.test.tsuses it. The published peer is the exact release version, which is what the lockstep check inscripts/release-artifacts.mjsrequires.@sentry/junior:nitrois now a direct peer dependency. Core importsnitro/typesand wraps the host's Nitro build, so the host's Nitro is the one it must use. The exact version stays indevDependenciesfor the monorepo.nitroand must use a version in the peer range.Do plugins need peer dependencies?
No. Only
@sentry/junior-dashboarddepends on@sentry/junior. The plugins (github, google, linear, memory, sentry, vercel, and the others) depend only on@sentry/junior-plugin-api. That package has no peers, so the host's Nitro version cannot split it. A package needs@sentry/junioras a peer only when it must share the module state of core, such as the plugin registry. The dashboard is the only such package.Result for hosts
The host picks one Nitro version. It has to own that dependency: it runs
nitro build, and itsnitro.config.tsimportsdefineConfigfromnitro. Any version in Junior's peer range works. If the version is out of range, pnpm reportsunmet peer nitro. It does not install a second core.Peer range
3.0.260415-beta || 3.0.260429-beta || 3.0.260522-beta || 3.0.260603-beta || 3.0.260610-beta || 3.0.260903-betaI built
apps/examplewith each of these versions as the host'snitro, then ranscripts/check-vercel-output.mjs. Every build passed, and the example and the dashboard resolved to one@sentry/juniorcopy. The server output had onegetPluginsdefinition.3.0.260415-betais the version that junior-prod runs, and it is the first beta withvercel.functionRules, whichjuniorNitro()uses for queue triggers.3.0.260311-betadoes not have that option, and its build did not finish. pnpm shows the out-of-range warning for it.The list names each beta because npm and yarn do not match prerelease versions against a range such as
>=3.0.260415-beta.@sentry/nitrouses the same pattern.3.0.261029-rcis not in the list. It is newer than the repo'sminimumReleaseAge, so I could not install it to test. A new Nitro release needs one more entry here after the example build passes with it.Proposal (not in this PR)
Junior could own the Nitro version fully. It would make
nitroa regular dependency, re-exportdefineConfigfrom@sentry/junior/nitro, and run the build through thejuniorCLI (for examplejunior buildinstead ofnitro build). Then hosts would never pick a Nitro version. The cost is a new CLI surface, and hosts that already use Nitro for their own routes would lose control of the version.No startup guard
I did not add a startup guard that detects a second core instance. The peer dependencies remove the cause. A guard would need a new identity field in the core-to-dashboard contract only to catch a packaging mistake.
via David Cramer.
--
View Session [Sentry]