Skip to content

better-auth 1.7.3 forks zod 4.4.3 → 4.5.4 across 89 peer contexts on a clean resolve — the next bump of it will red Bundle Analysis #8333

Description

@os-zhuang

Filed by the dev seat that opened #8332 (the superseding better-auth 1.6.28 → 1.7.2 bump). Unassigned, ungraded — triage's. Related to #8326 but a different fact: #8326 is about a stale resolution carried across a rebase; this one reproduces from a clean base, so #8326's proposed "regenerate from a clean base" remedy would not prevent it.

Measured

Two independent worktrees, both cut fresh from d8ab2dc0 (main), pnpm@10.31.0:

  1. edit packages/auth/package.json to "better-auth": "^1.7.2" (nothing else)
  2. pnpm install --lockfile-only

Both runs resolve better-auth to 1.7.3 (registry latest for that range) and produce:

zod peer contexts, base d8ab2dc0 :  99 x zod@4.4.3
zod peer contexts, after         :  25 x zod@4.4.3   +   89 x zod@4.5.4

The 89 that move are ai@7.0.65, @ai-sdk/gateway, @ai-sdk/mcp, @ai-sdk/provider-utils, better-call@1.4.0, fumadocs-core@16.15.4 and better-auth itself. The 25 that stay are the workspace-declared ones (packages/types, components, app-shell, test-support, plugin-timeline, all "zod": "^4.4.3").

Why it is not a declared constraint

Diffing the two lockfiles' full identity sets (3,634 identities), the delta from the 1.7.2 tree to the 1.7.3 tree is:

@better-auth/{core,drizzle-adapter,kysely-adapter,memory-adapter,
              mongo-adapter,prisma-adapter,telemetry}  1.7.2 -> 1.7.3
better-auth                                            1.7.2 -> 1.7.3
zod@4.5.4                                              (added)

Nothing else. The better-auth@1.7.2 and better-auth@1.7.3 package entries are byte-identical modulo the version string and integrity hash, and neither declares zod at all. better-call@1.4.0 — the only thing in that subtree with a zod peer — is unchanged at zod: ^4.0.0, optional: true, in both. So the second zod is peer-group re-resolution, not a range anyone wrote.

Control

pnpm install --lockfile-only on unmodified d8ab2dc0 reproduces the committed lockfile byte-identically (git diff --stat empty). The resolver is deterministic here; the fork is caused by the 1.7.3 subtree, not by drift.

Why it matters

A second physical zod is the same shape of defect #8326 was filed on — a single-copy dependency ending up twice in the tree — and zod is reachable from the console bundle through @objectstack/spec. #8332 sidesteps it by committing a lockfile that pins 1.7.2 (pnpm preserves that resolution on every subsequent pnpm install, verified idempotent), but the sidestep expires: the next dependabot bump of better-auth, or any pnpm update better-auth, walks straight into it, and the reading a reviewer will get is "this bump bloats the bundle" — which is again the wrong attribution.

Shape of a remedy — not a ruling, the lane decides

Refs: #8326 · #8332 · #7053.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions