Skip to content

fix(deps): Let the host own nitro and @sentry/junior - #2403

Merged
dcramer merged 3 commits into
mainfrom
fix/dashboard-junior-peer
Oct 30, 2026
Merged

dcramer merged 3 commits into
mainfrom
fix/dashboard-junior-peer

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Follows getsentry/junior-prod#574.

Cause

@sentry/junior-dashboard listed @sentry/junior (published as an exact version) and nitro: 3.0.260522-beta in dependencies. The dashboard never imports nitro. @sentry/junior got nitro only as a peer of @sentry/nitro. junior-prod pinned [email protected], so pnpm installed @sentry/junior twice: 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/api from 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/junior moves to peerDependencies, so the dashboard uses the core copy that the host installs. nitro moves to devDependencies, because only tests/dashboard-output.test.ts uses it. The published peer is the exact release version, which is what the lockstep check in scripts/release-artifacts.mjs requires.
  • @sentry/junior: nitro is now a direct peer dependency. Core imports nitro/types and wraps the host's Nitro build, so the host's Nitro is the one it must use. The exact version stays in devDependencies for the monorepo.
  • Docs: the dashboard install page says to install the same version of both packages. The existing-app page says the app owns nitro and must use a version in the peer range.

Do plugins need peer dependencies?

No. Only @sentry/junior-dashboard depends 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/junior as 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 its nitro.config.ts imports defineConfig from nitro. Any version in Junior's peer range works. If the version is out of range, pnpm reports unmet 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-beta

I built apps/example with each of these versions as the host's nitro, then ran scripts/check-vercel-output.mjs. Every build passed, and the example and the dashboard resolved to one @sentry/junior copy. The server output had one getPlugins definition. 3.0.260415-beta is the version that junior-prod runs, and it is the first beta with vercel.functionRules, which juniorNitro() uses for queue triggers. 3.0.260311-beta does 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/nitro uses the same pattern. 3.0.261029-rc is not in the list. It is newer than the repo's minimumReleaseAge, 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 nitro a regular dependency, re-export defineConfig from @sentry/junior/nitro, and run the build through the junior CLI (for example junior build instead of nitro 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]

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]>
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 30, 2026 2:55am UTC

Request Review

@sentry-evals

sentry-evals Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Sentry Evals

junior-behavioral

Run Status Passed Failed Errored Cost Tokens Duration
Head Error 80 1 1 $1.50 0 395.31s

Base commit e3d7cc6 has no eval run to compare against.

junior-integration

Run Status Passed Failed Errored Cost Tokens Duration
Head Passed 102 0 0 $0.90 0 241.67s

Base commit e3d7cc6 has no eval run to compare against.

@dcramer

dcramer commented Oct 30, 2026

Copy link
Copy Markdown
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.
@sentry-junior sentry-junior Bot changed the title fix(dashboard): Make @sentry/junior a peer dependency fix(deps): Let the host own nitro and @sentry/junior Oct 30, 2026
@dcramer
dcramer merged commit 8c45aeb into main Oct 30, 2026
49 of 50 checks passed
@dcramer
dcramer deleted the fix/dashboard-junior-peer branch October 30, 2026 03:00

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 12e429aa Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant