[PR #5631] [MERGED] chore(organization): fix client side import server side code #23028

Closed
opened 2026-04-15 21:25:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5631
Author: @himself65
Created: 10/28/2025
Status: Merged
Merged: 10/28/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/10/27/import


📝 Commits (1)

  • b49e275 chore(organization): fix client side import server side code

📊 Changes

3 files changed (+18 additions, -3 deletions)

View changed files

📝 e2e/smoke/test/fixtures/vite/vite.config.ts (+0 -1)
📝 e2e/smoke/test/vite.spec.ts (+17 -1)
📝 packages/better-auth/src/plugins/organization/client.ts (+1 -1)

📄 Description

Summary by cubic

Prevents server-only code from being bundled into the client by switching to a type-only import and tightening the Vite e2e test. Keeps the client build free of Node APIs like async_hooks.

  • Bug Fixes
    • Use import type for OrganizationPlugin to avoid runtime imports on the client.
    • Remove server entry from the Vite fixture to build only the client.
    • Update e2e Vite test to fail if build output contains unexpected server-side strings (e.g., async_hooks).

🔄 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/5631 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/28/2025 **Status:** ✅ Merged **Merged:** 10/28/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/27/import` --- ### 📝 Commits (1) - [`b49e275`](https://github.com/better-auth/better-auth/commit/b49e275e145842f455db4b9b2577a4cb5e9bbd64) chore(organization): fix client side import server side code ### 📊 Changes **3 files changed** (+18 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `e2e/smoke/test/fixtures/vite/vite.config.ts` (+0 -1) 📝 `e2e/smoke/test/vite.spec.ts` (+17 -1) 📝 `packages/better-auth/src/plugins/organization/client.ts` (+1 -1) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Prevents server-only code from being bundled into the client by switching to a type-only import and tightening the Vite e2e test. Keeps the client build free of Node APIs like async_hooks. - **Bug Fixes** - Use `import type` for `OrganizationPlugin` to avoid runtime imports on the client. - Remove `server` entry from the Vite fixture to build only the client. - Update e2e Vite test to fail if build output contains unexpected server-side strings (e.g., async_hooks). <!-- 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-15 21:25:59 -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#23028