diff --git a/js/util.ts b/js/util.ts index 2f9146e..5fba1f5 100644 --- a/js/util.ts +++ b/js/util.ts @@ -32,8 +32,8 @@ declare global { var __inherited_braintrust_state: any; } export function currentSpan() { - if (__inherited_braintrust_state) { - return __inherited_braintrust_state.currentSpan.getStore(); + if (globalThis.__inherited_braintrust_state) { + return globalThis.__inherited_braintrust_state.currentSpan.getStore(); } else { return new NoopSpan(); }