Skip to content

Fresh projects: every auth endpoint returns 500 "Cannot set properties of undefined (setting 'modelName')" — fixed in 15.1.1 #3091

Description

@os-zhuang

If you hit this

Any project scaffolded with npx create-objectstack between 13.0.0 (released 2026-07-09) and 15.1.0 shipped with broken authentication out of the box:

  • POST /api/v1/auth/sign-up/email500
  • POST /api/v1/auth/sign-in/email500
  • GET /api/v1/auth/get-session500
  • Server log at startup: Failed to register OIDC discovery routes … Cannot set properties of undefined (setting 'modelName')
  • The Console login page appears to redirect-loop and registration fails

Fix — upgrade to 15.1.1

pnpm update "@objectstack/*"    # or: npm update
# restart your dev server, then:
curl -s localhost:3000/api/v1/auth/get-session   # expect 200

No config changes and no data migration needed (auth never worked on affected versions, so there is nothing to migrate). Projects scaffolded from today get 15.1.1 automatically.

Root cause

The framework workspace pinned the better-auth family to 1.7.0-rc.1 via pnpm overrides — required because GHSA-j8v8-g9cx-5qf4 (high) is only fixed in the 1.7.0 pre-release line. But pnpm overrides don't ship with published packages: the published @objectstack/plugin-auth still declared ^1.6.23, so fresh installs resolved a dependency combination that was never tested in CI and crashes during better-auth initialization.

Fixed by:

Verified end-to-end on a fresh npx create-objectstack@latest project: all auth endpoints return 200, zero errors at startup.

Sorry for the rough first-run experience if this hit you — this exact failure mode (publish-artifact smoke on a clean install) is now covered by CI.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions