Skip to content

chore(ui): pin nitro instead of tracking the latest dist-tag - #2321

Open
Rajarshi Datta (rajarshidattapy) wants to merge 1 commit into
langchain-ai:mainfrom
rajarshidattapy:chore/pin-nitro
Open

chore(ui): pin nitro instead of tracking the latest dist-tag#2321
Rajarshi Datta (rajarshidattapy) wants to merge 1 commit into
langchain-ai:mainfrom
rajarshidattapy:chore/pin-nitro

Conversation

@rajarshidattapy

Copy link
Copy Markdown

Fixes #2309.

Problem

// ui/package.json
"nitro": "latest",

This is the only floating specifier in the workspace — grep -rn '": *"\(latest\|\*\|x\)"' --include=package.json . matches this line and nothing else.

pnpm-lock.yaml holds the resolution today, so ordinary installs are reproducible. The exposure is any operation that refreshes the lock — pnpm update, a Dependabot/Renovate lock refresh, or a conflict resolved by regenerating. Each silently accepts whatever the newest published nitro is, including a new major, with no range to reject it and no signal in the diff beyond a lockfile line.

Two things make it sharper than a typical floating pin:

  • It is on the build and request path. nitro is the server runtime under the TanStack Start dashboard and is imported directly: ui/vite.config.ts:7 does import { nitro } from "nitro/vite", and it is configured at :178. A surprise version lands there, not in a leaf utility.
  • latest currently resolves to a pre-release: 3.0.260610-beta. The dist-tag points at a v3 beta, so this specifier is tracking a moving beta rather than a stable line.

Change

Pin exactly at the version already installed:

-    "nitro": "latest",
+    "nitro": "3.0.260610-beta",

Exact, not a caret range. The issue suggested ^3.x.y, but a caret over a pre-release only matches pre-releases of the same major.minor.patch — surprising semantics, and not the intent. Exact is also what this file already does for its other pre-release dependencies:

"@pierre/trees": "1.0.0-beta.4",
"h3": "2.0.1-rc.22",

h3 is the closest precedent — same unjs ecosystem as nitro, pinned exactly at an rc.

No dependency moves

The lockfile diff is the specifier string only. The resolved version is byte-identical before and after:

       nitro:
-        specifier: latest
+        specifier: 3.0.260610-beta
         version: 3.0.260610-beta(chokidar@5.0.0)(dotenv@17.4.2)(...)

Regenerated with pnpm install --lockfile-only; two files change by one line each.

Verification

  • pnpm install --frozen-lockfile --filter open-swe-dashboard... --filter open-swe — "Lockfile is up to date, resolution step is skipped". This is the path every JS CI job takes, and it is the thing a package.json edit most easily breaks.
  • Installed version after the change: 3.0.260610-beta, unchanged.
  • pnpm --filter open-swe-dashboard run typecheck — exit 0.
  • pnpm --filter open-swe-dashboard run test — 66 files, 303 tests passed.

One note on the test evidence, since I hit it and it would be misleading to omit: two of my local runs of the full UI suite were flaky under load on Windows — one reported 6 worker errors, another a 5000ms timeout in src/routes/-admin.test.tsx. Run in isolation that file passes on this branch and on unmodified main, so it is machine contention rather than anything here. Worth saying plainly: since the resolved dependency tree does not change at all, this PR cannot affect test behaviour either way.

`nitro` was the only floating specifier in the workspace — a grep for
`"latest"`, `"*"` or `"x"` across every package.json matched this one line and
nothing else.

The lockfile holds the resolution today, so ordinary installs are reproducible.
The exposure is any operation that refreshes the lock: `pnpm update`, a bot's
lock refresh, or a conflict resolved by regenerating. Each of those silently
accepts whatever the newest published `nitro` is, with no range to reject it and
no signal in the diff beyond a lockfile line.

That matters more than usual here for two reasons. `nitro` is the server runtime
under the TanStack Start dashboard and is imported directly by the build
(`ui/vite.config.ts` does `import { nitro } from "nitro/vite"`), so a surprise
version lands on the build and request path rather than in a leaf utility. And
`latest` currently resolves to `3.0.260610-beta` — the dist-tag points at a v3
pre-release, so the floating specifier is tracking a moving beta.

Pin it exactly at the version already installed. An exact pin rather than a
caret range because caret ranges over a pre-release only match pre-releases of
the same major.minor.patch, which is both surprising and not what is wanted
here. This matches how the file already treats its other pre-release pins:
`h3` at `2.0.1-rc.22` and `@pierre/trees` at `1.0.0-beta.4`.

No dependency moves: the lockfile diff is the specifier string only, and the
resolved version is unchanged.

Fixes langchain-ai#2309
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant