diff --git a/packages/effect/src/GlobalValue.ts b/packages/effect/src/GlobalValue.ts index 0d18cc15fe..5987615fa0 100644 --- a/packages/effect/src/GlobalValue.ts +++ b/packages/effect/src/GlobalValue.ts @@ -44,7 +44,7 @@ let globalStore: Map export const globalValue = (id: unknown, compute: () => A): A => { if (!globalStore) { // @ts-expect-error - globalThis[globalStoreId] = new Map() + globalThis[globalStoreId] ??= new Map() // @ts-expect-error globalStore = globalThis[globalStoreId] as Map }