diff --git a/packages/relay-runtime/store/RelayPublishQueue.js b/packages/relay-runtime/store/RelayPublishQueue.js index 92f236e91d09d..8c9e8871bd097 100644 --- a/packages/relay-runtime/store/RelayPublishQueue.js +++ b/packages/relay-runtime/store/RelayPublishQueue.js @@ -57,8 +57,15 @@ type PendingUpdater = {| +updater: StoreUpdater, |}; +const _global: typeof global | $FlowFixMe = + typeof global !== 'undefined' + ? global + : typeof window !== 'undefined' + ? window + : undefined; + const applyWithGuard = - global?.ErrorUtils?.applyWithGuard ?? + _global?.ErrorUtils?.applyWithGuard ?? ((callback, context, args, onError, name) => callback.apply(context, args)); /**