[PR #4857] [MERGED] chore: fix async local storage import #5620

Closed
opened 2026-03-13 12:29:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4857
Author: @himself65
Created: 9/23/2025
Status: Merged
Merged: 9/23/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/09/23/als


📝 Commits (1)

  • 5700304 chore: fix async local storage import

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/context/transaction.ts (+4 -1)

📄 Description

Summary by cubic

Fixes AsyncLocalStorage import in the transaction context to prevent errors in non-Node environments. Uses a type-only import, dynamically loads AsyncLocalStorage, and falls back to globalThis with a warning when unavailable.


🔄 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/4857 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/23/2025 **Status:** ✅ Merged **Merged:** 9/23/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/09/23/als` --- ### 📝 Commits (1) - [`5700304`](https://github.com/better-auth/better-auth/commit/57003048a363480af14f12ad64de62610a722a5d) chore: fix async local storage import ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/context/transaction.ts` (+4 -1) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes AsyncLocalStorage import in the transaction context to prevent errors in non-Node environments. Uses a type-only import, dynamically loads AsyncLocalStorage, and falls back to globalThis with a warning when unavailable. <!-- 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-03-13 12:29:36 -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#5620