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
fix(plugin-auth): pin better-auth family to 1.7.0-rc.1 in the published manifest (#3085)
Every fresh `npx create-objectstack` (15.1.0) project shipped with auth
returning 500 on sign-up / sign-in / get-session: "Cannot set properties
of undefined (setting 'modelName')", thrown from
@better-auth/oauth-provider@1.6.23 during better-auth init.
The workspace forces the whole better-auth family to 1.7.0-rc.1 via
pnpm-workspace.yaml overrides (GHSA-j8v8-g9cx-5qf4 is only fixed in the
1.7.0 pre-release line, see 602053c), so every CI job and showcase here
ran a graph downstream installs can never reproduce: overrides do not
ship with published packages, and plugin-auth still declared ^1.6.23 for
better-auth / @better-auth/core / @better-auth/oauth-provider /
@better-auth/sso. Downstream resolved those to 1.6.23 (still the npm
`latest`), and the 1.7 scim + 1.6.23 rest mix crashes at startup.
- Pin all four to the exact 1.7.0-rc.1 (same as @better-auth/scim) — the
only combination this repo actually builds and tests. No `^` on the rc:
npm's default resolution never selects a prerelease from a caret range,
which is precisely how this drift shipped. Relax to ^1.7.0 once a
stable better-auth 1.7.0 exists.
- Workspace lockfile is unchanged by the pin (pnpm already resolved these
to 1.7.0-rc.1 via the overrides); the overrides stay as belt-and-braces.
- Add scripts/check-override-consistency.mjs + a validate-deps step: for
every pnpm-workspace override whose package appears in a publishable
package's dependencies/optionalDependencies/peerDependencies, the
declared range must resolve to the override target under npm's default
(no-prerelease) semantics, so tested-vs-published drift fails CI with a
"overrides do not ship with published packages" hint instead of
shipping silently. Needs semver, added as a root devDependency.
Verified against the packed artifact: `pnpm pack` of this plugin-auth,
installed into a fresh create-objectstack@15.1.0 project via a pnpm
override — lockfile resolves the whole family (adapters + telemetry
included) to 1.7.0-rc.1, startup log has zero "Failed to register OIDC
discovery routes", and sign-up / sign-in / get-session all return 200. A
control project without the override reproduces the three 500s.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Fix fresh-project auth returning 500 on every endpoint (sign-up / sign-in / get-session) with `Cannot set properties of undefined (setting 'modelName')`.
6
+
7
+
The published manifest declared `better-auth`, `@better-auth/core`, `@better-auth/oauth-provider`, and `@better-auth/sso` as `^1.6.23`, while only `@better-auth/scim` was pinned to `1.7.0-rc.1` (GHSA-j8v8-g9cx-5qf4 is fixed only in the 1.7.0 pre-release line). The framework workspace forces the whole better-auth family to `1.7.0-rc.1` via pnpm overrides, but overrides do not ship with published packages — a downstream `npx create-objectstack` install resolved the `^1.6.23` ranges to 1.6.23 (still the npm `latest`), and the resulting 1.7/1.6 mix crashes during better-auth initialization, so every fresh 15.1.0 project shipped with broken auth.
8
+
9
+
All four packages are now pinned to the exact `1.7.0-rc.1` — the only combination the workspace actually builds and tests against. The pins will be relaxed to `^1.7.0` once a stable better-auth 1.7.0 ships. A new CI gate (`scripts/check-override-consistency.mjs`) fails whenever a pnpm-workspace override target is not reachable from a publishable package's declared range, so tested-vs-published drift like this cannot recur silently.
0 commit comments