[PR #4113] [MERGED] fix(cli): generate throws error with default export #13441

Closed
opened 2026-04-13 08:56:25 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4113
Author: @himself65
Created: 8/20/2025
Status: Merged
Merged: 8/20/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/08/20/cli-export-default


📝 Commits (1)

  • b4a7bd4 fix(cli): generate throws error with default export

📊 Changes

4 files changed (+241 additions, -84 deletions)

View changed files

📝 packages/cli/package.json (+1 -1)
📝 packages/cli/src/utils/get-config.ts (+26 -11)
📝 packages/cli/test/get-config.test.ts (+122 -1)
📝 pnpm-lock.yaml (+92 -71)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4110


Summary by cubic

Fixes the CLI generate crash when the auth config is default-exported. get-config now reads default exports (including inline betterAuth()) and shows clearer errors when the config can’t be loaded.

  • Bug Fixes

    • Read auth config from default exports (including inline betterAuth()), preventing generate from throwing.
    • Improve error output when config load fails.
    • Type jiti options with JitiOptions.
  • Dependencies

    • Upgrade c12 to 3.2.0.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/4113 **Author:** [@himself65](https://github.com/himself65) **Created:** 8/20/2025 **Status:** ✅ Merged **Merged:** 8/20/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/08/20/cli-export-default` --- ### 📝 Commits (1) - [`b4a7bd4`](https://github.com/better-auth/better-auth/commit/b4a7bd4a2eb202157ee89b84b5c2861fecfe0eb1) fix(cli): `generate` throws error with default export ### 📊 Changes **4 files changed** (+241 additions, -84 deletions) <details> <summary>View changed files</summary> 📝 `packages/cli/package.json` (+1 -1) 📝 `packages/cli/src/utils/get-config.ts` (+26 -11) 📝 `packages/cli/test/get-config.test.ts` (+122 -1) 📝 `pnpm-lock.yaml` (+92 -71) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4110 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes the CLI generate crash when the auth config is default-exported. get-config now reads default exports (including inline betterAuth()) and shows clearer errors when the config can’t be loaded. - **Bug Fixes** - Read auth config from default exports (including inline betterAuth()), preventing generate from throwing. - Improve error output when config load fails. - Type jiti options with JitiOptions. - **Dependencies** - Upgrade c12 to 3.2.0. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 08:56:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#13441